freenect.c
Go to the documentation of this file.
1 /* Generated by Cython 0.20.2 on Wed Jul 2 20:29:36 2014 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #ifndef CYTHON_USE_PYLONG_INTERNALS
5 #ifdef PYLONG_BITS_IN_DIGIT
6 #define CYTHON_USE_PYLONG_INTERNALS 0
7 #else
8 #include "pyconfig.h"
9 #ifdef PYLONG_BITS_IN_DIGIT
10 #define CYTHON_USE_PYLONG_INTERNALS 1
11 #else
12 #define CYTHON_USE_PYLONG_INTERNALS 0
13 #endif
14 #endif
15 #endif
16 #include "Python.h"
17 #ifndef Py_PYTHON_H
18  #error Python headers needed to compile C extensions, please install development version of Python.
19 #elif PY_VERSION_HEX < 0x02040000
20  #error Cython requires Python 2.4+.
21 #else
22 #define CYTHON_ABI "0_20_2"
23 #include <stddef.h> /* For offsetof */
24 #ifndef offsetof
25 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
26 #endif
27 #if !defined(WIN32) && !defined(MS_WINDOWS)
28  #ifndef __stdcall
29  #define __stdcall
30  #endif
31  #ifndef __cdecl
32  #define __cdecl
33  #endif
34  #ifndef __fastcall
35  #define __fastcall
36  #endif
37 #endif
38 #ifndef DL_IMPORT
39  #define DL_IMPORT(t) t
40 #endif
41 #ifndef DL_EXPORT
42  #define DL_EXPORT(t) t
43 #endif
44 #ifndef PY_LONG_LONG
45  #define PY_LONG_LONG LONG_LONG
46 #endif
47 #ifndef Py_HUGE_VAL
48  #define Py_HUGE_VAL HUGE_VAL
49 #endif
50 #ifdef PYPY_VERSION
51 #define CYTHON_COMPILING_IN_PYPY 1
52 #define CYTHON_COMPILING_IN_CPYTHON 0
53 #else
54 #define CYTHON_COMPILING_IN_PYPY 0
55 #define CYTHON_COMPILING_IN_CPYTHON 1
56 #endif
57 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
58 #define Py_OptimizeFlag 0
59 #endif
60 #if PY_VERSION_HEX < 0x02050000
61  typedef int Py_ssize_t;
62  #define PY_SSIZE_T_MAX INT_MAX
63  #define PY_SSIZE_T_MIN INT_MIN
64  #define PY_FORMAT_SIZE_T ""
65  #define CYTHON_FORMAT_SSIZE_T ""
66  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
67  #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o)
68  #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
69  (PyErr_Format(PyExc_TypeError, \
70  "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
71  (PyObject*)0))
72  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
73  !PyComplex_Check(o))
74  #define PyIndex_Check __Pyx_PyIndex_Check
75  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
76  #define __PYX_BUILD_PY_SSIZE_T "i"
77 #else
78  #define __PYX_BUILD_PY_SSIZE_T "n"
79  #define CYTHON_FORMAT_SSIZE_T "z"
80  #define __Pyx_PyIndex_Check PyIndex_Check
81 #endif
82 #if PY_VERSION_HEX < 0x02060000
83  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
84  #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
85  #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
86  #define PyVarObject_HEAD_INIT(type, size) \
87  PyObject_HEAD_INIT(type) size,
88  #define PyType_Modified(t)
89  typedef struct {
90  void *buf;
91  PyObject *obj;
92  Py_ssize_t len;
93  Py_ssize_t itemsize;
94  int readonly;
95  int ndim;
96  char *format;
97  Py_ssize_t *shape;
98  Py_ssize_t *strides;
99  Py_ssize_t *suboffsets;
100  void *internal;
101  } Py_buffer;
102  #define PyBUF_SIMPLE 0
103  #define PyBUF_WRITABLE 0x0001
104  #define PyBUF_FORMAT 0x0004
105  #define PyBUF_ND 0x0008
106  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
107  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
108  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
109  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
110  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
111  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
112  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
113  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
114  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
115 #endif
116 #if PY_MAJOR_VERSION < 3
117  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
118  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
119  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
120  #define __Pyx_DefaultClassType PyClass_Type
121 #else
122  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
123  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
124  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
125  #define __Pyx_DefaultClassType PyType_Type
126 #endif
127 #if PY_VERSION_HEX < 0x02060000
128  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
129 #endif
130 #if PY_MAJOR_VERSION >= 3
131  #define Py_TPFLAGS_CHECKTYPES 0
132  #define Py_TPFLAGS_HAVE_INDEX 0
133 #endif
134 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
135  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
136 #endif
137 #if PY_VERSION_HEX < 0x02060000
138  #define Py_TPFLAGS_HAVE_VERSION_TAG 0
139 #endif
140 #if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
141  #define Py_TPFLAGS_IS_ABSTRACT 0
142 #endif
143 #if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
144  #define Py_TPFLAGS_HAVE_FINALIZE 0
145 #endif
146 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
147  #define CYTHON_PEP393_ENABLED 1
148  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
149  0 : _PyUnicode_Ready((PyObject *)(op)))
150  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
151  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
152  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
153  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
154  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
155 #else
156  #define CYTHON_PEP393_ENABLED 0
157  #define __Pyx_PyUnicode_READY(op) (0)
158  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
159  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
160  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
161  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
162  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
163 #endif
164 #if CYTHON_COMPILING_IN_PYPY
165  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
166  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
167 #else
168  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
169  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
170  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
171 #endif
172 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
173 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
174 #if PY_MAJOR_VERSION >= 3
175  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
176 #else
177  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
178 #endif
179 #if PY_MAJOR_VERSION >= 3
180  #define PyBaseString_Type PyUnicode_Type
181  #define PyStringObject PyUnicodeObject
182  #define PyString_Type PyUnicode_Type
183  #define PyString_Check PyUnicode_Check
184  #define PyString_CheckExact PyUnicode_CheckExact
185 #endif
186 #if PY_VERSION_HEX < 0x02060000
187  #define PyBytesObject PyStringObject
188  #define PyBytes_Type PyString_Type
189  #define PyBytes_Check PyString_Check
190  #define PyBytes_CheckExact PyString_CheckExact
191  #define PyBytes_FromString PyString_FromString
192  #define PyBytes_FromStringAndSize PyString_FromStringAndSize
193  #define PyBytes_FromFormat PyString_FromFormat
194  #define PyBytes_DecodeEscape PyString_DecodeEscape
195  #define PyBytes_AsString PyString_AsString
196  #define PyBytes_AsStringAndSize PyString_AsStringAndSize
197  #define PyBytes_Size PyString_Size
198  #define PyBytes_AS_STRING PyString_AS_STRING
199  #define PyBytes_GET_SIZE PyString_GET_SIZE
200  #define PyBytes_Repr PyString_Repr
201  #define PyBytes_Concat PyString_Concat
202  #define PyBytes_ConcatAndDel PyString_ConcatAndDel
203 #endif
204 #if PY_MAJOR_VERSION >= 3
205  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
206  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
207 #else
208  #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
209  PyString_Check(obj) || PyUnicode_Check(obj))
210  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
211 #endif
212 #if PY_VERSION_HEX < 0x02060000
213  #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
214  #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
215 #endif
216 #ifndef PySet_CheckExact
217  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
218 #endif
219 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
220 #if PY_MAJOR_VERSION >= 3
221  #define PyIntObject PyLongObject
222  #define PyInt_Type PyLong_Type
223  #define PyInt_Check(op) PyLong_Check(op)
224  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
225  #define PyInt_FromString PyLong_FromString
226  #define PyInt_FromUnicode PyLong_FromUnicode
227  #define PyInt_FromLong PyLong_FromLong
228  #define PyInt_FromSize_t PyLong_FromSize_t
229  #define PyInt_FromSsize_t PyLong_FromSsize_t
230  #define PyInt_AsLong PyLong_AsLong
231  #define PyInt_AS_LONG PyLong_AS_LONG
232  #define PyInt_AsSsize_t PyLong_AsSsize_t
233  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
234  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
235  #define PyNumber_Int PyNumber_Long
236 #endif
237 #if PY_MAJOR_VERSION >= 3
238  #define PyBoolObject PyLongObject
239 #endif
240 #if PY_VERSION_HEX < 0x030200A4
241  typedef long Py_hash_t;
242  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
243  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
244 #else
245  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
246  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
247 #endif
248 #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
249  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
250  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
251  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
252 #else
253  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
254  (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
255  (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
256  (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
257  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
258  (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
259  (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
260  (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
261  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
262  (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
263  (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
264  (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
265 #endif
266 #if PY_MAJOR_VERSION >= 3
267  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
268 #endif
269 #if PY_VERSION_HEX < 0x02050000
270  #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
271  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
272  #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
273 #else
274  #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
275  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
276  #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
277 #endif
278 #if PY_VERSION_HEX < 0x02050000
279  #define __Pyx_NAMESTR(n) ((char *)(n))
280  #define __Pyx_DOCSTR(n) ((char *)(n))
281 #else
282  #define __Pyx_NAMESTR(n) (n)
283  #define __Pyx_DOCSTR(n) (n)
284 #endif
285 #ifndef CYTHON_INLINE
286  #if defined(__GNUC__)
287  #define CYTHON_INLINE __inline__
288  #elif defined(_MSC_VER)
289  #define CYTHON_INLINE __inline
290  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
291  #define CYTHON_INLINE inline
292  #else
293  #define CYTHON_INLINE
294  #endif
295 #endif
296 #ifndef CYTHON_RESTRICT
297  #if defined(__GNUC__)
298  #define CYTHON_RESTRICT __restrict__
299  #elif defined(_MSC_VER) && _MSC_VER >= 1400
300  #define CYTHON_RESTRICT __restrict
301  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
302  #define CYTHON_RESTRICT restrict
303  #else
304  #define CYTHON_RESTRICT
305  #endif
306 #endif
307 #ifdef NAN
308 #define __PYX_NAN() ((float) NAN)
309 #else
310 static CYTHON_INLINE float __PYX_NAN() {
311  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
312  a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
313  a quiet NaN. */
314  float value;
315  memset(&value, 0xFF, sizeof(value));
316  return value;
317 }
318 #endif
319 #ifdef __cplusplus
320 template<typename T>
321 void __Pyx_call_destructor(T* x) {
322  x->~T();
323 }
324 #endif
325 
326 
327 #if PY_MAJOR_VERSION >= 3
328  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
329  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
330 #else
331  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
332  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
333 #endif
334 
335 #ifndef __PYX_EXTERN_C
336  #ifdef __cplusplus
337  #define __PYX_EXTERN_C extern "C"
338  #else
339  #define __PYX_EXTERN_C extern
340  #endif
341 #endif
342 
343 #if defined(WIN32) || defined(MS_WINDOWS)
344 #define _USE_MATH_DEFINES
345 #endif
346 #include <math.h>
347 #define __PYX_HAVE__freenect
348 #define __PYX_HAVE_API__freenect
349 #include "stdint.h"
350 #include "string.h"
351 #include "stdio.h"
352 #include "stdlib.h"
353 #include "numpy/arrayobject.h"
354 #include "numpy/ufuncobject.h"
355 #include "libfreenect.h"
356 #include "libfreenect_sync.h"
357 #ifdef _OPENMP
358 #include <omp.h>
359 #endif /* _OPENMP */
360 
361 #ifdef PYREX_WITHOUT_ASSERTIONS
362 #define CYTHON_WITHOUT_ASSERTIONS
363 #endif
364 
365 #ifndef CYTHON_UNUSED
366 # if defined(__GNUC__)
367 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
368 # define CYTHON_UNUSED __attribute__ ((__unused__))
369 # else
370 # define CYTHON_UNUSED
371 # endif
372 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
373 # define CYTHON_UNUSED __attribute__ ((__unused__))
374 # else
375 # define CYTHON_UNUSED
376 # endif
377 #endif
378 typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
379  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
380 
381 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
382 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
383 #define __PYX_DEFAULT_STRING_ENCODING ""
384 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
385 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
386 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
387  (sizeof(type) < sizeof(Py_ssize_t)) || \
388  (sizeof(type) > sizeof(Py_ssize_t) && \
389  likely(v < (type)PY_SSIZE_T_MAX || \
390  v == (type)PY_SSIZE_T_MAX) && \
391  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
392  v == (type)PY_SSIZE_T_MIN))) || \
393  (sizeof(type) == sizeof(Py_ssize_t) && \
394  (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
395  v == (type)PY_SSIZE_T_MAX))) )
396 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
397 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
398 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
399 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
400 #define __Pyx_PyBytes_FromString PyBytes_FromString
401 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
402 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
403 #if PY_MAJOR_VERSION < 3
404  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
405  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
406 #else
407  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
408  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
409 #endif
410 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
411 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
412 #define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
413 #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
414 #define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
415 #define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
416 #define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
417 #if PY_MAJOR_VERSION < 3
418 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
419 {
420  const Py_UNICODE *u_end = u;
421  while (*u_end++) ;
422  return (size_t)(u_end - u - 1);
423 }
424 #else
425 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
426 #endif
427 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
428 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
429 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
430 #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
431 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
432 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
433 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
434 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
435 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
436 #if CYTHON_COMPILING_IN_CPYTHON
437 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
438 #else
439 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
440 #endif
441 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
442 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
443 static int __Pyx_sys_getdefaultencoding_not_ascii;
444 static int __Pyx_init_sys_getdefaultencoding_params(void) {
445  PyObject* sys;
446  PyObject* default_encoding = NULL;
447  PyObject* ascii_chars_u = NULL;
448  PyObject* ascii_chars_b = NULL;
449  const char* default_encoding_c;
450  sys = PyImport_ImportModule("sys");
451  if (!sys) goto bad;
452  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
453  Py_DECREF(sys);
454  if (!default_encoding) goto bad;
455  default_encoding_c = PyBytes_AsString(default_encoding);
456  if (!default_encoding_c) goto bad;
457  if (strcmp(default_encoding_c, "ascii") == 0) {
458  __Pyx_sys_getdefaultencoding_not_ascii = 0;
459  } else {
460  char ascii_chars[128];
461  int c;
462  for (c = 0; c < 128; c++) {
463  ascii_chars[c] = c;
464  }
465  __Pyx_sys_getdefaultencoding_not_ascii = 1;
466  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
467  if (!ascii_chars_u) goto bad;
468  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
469  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
470  PyErr_Format(
471  PyExc_ValueError,
472  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
473  default_encoding_c);
474  goto bad;
475  }
476  Py_DECREF(ascii_chars_u);
477  Py_DECREF(ascii_chars_b);
478  }
479  Py_DECREF(default_encoding);
480  return 0;
481 bad:
482  Py_XDECREF(default_encoding);
483  Py_XDECREF(ascii_chars_u);
484  Py_XDECREF(ascii_chars_b);
485  return -1;
486 }
487 #endif
488 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
489 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
490 #else
491 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
492 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
493 static char* __PYX_DEFAULT_STRING_ENCODING;
494 static int __Pyx_init_sys_getdefaultencoding_params(void) {
495  PyObject* sys;
496  PyObject* default_encoding = NULL;
497  char* default_encoding_c;
498  sys = PyImport_ImportModule("sys");
499  if (!sys) goto bad;
500  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
501  Py_DECREF(sys);
502  if (!default_encoding) goto bad;
503  default_encoding_c = PyBytes_AsString(default_encoding);
504  if (!default_encoding_c) goto bad;
505  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
506  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
507  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
508  Py_DECREF(default_encoding);
509  return 0;
510 bad:
511  Py_XDECREF(default_encoding);
512  return -1;
513 }
514 #endif
515 #endif
516 
517 
518 /* Test for GCC > 2.95 */
519 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
520  #define likely(x) __builtin_expect(!!(x), 1)
521  #define unlikely(x) __builtin_expect(!!(x), 0)
522 #else /* !__GNUC__ or GCC < 2.95 */
523  #define likely(x) (x)
524  #define unlikely(x) (x)
525 #endif /* __GNUC__ */
526 
527 static PyObject *__pyx_m;
528 static PyObject *__pyx_d;
529 static PyObject *__pyx_b;
530 static PyObject *__pyx_empty_tuple;
531 static PyObject *__pyx_empty_bytes;
532 static int __pyx_lineno;
533 static int __pyx_clineno = 0;
534 static const char * __pyx_cfilenm= __FILE__;
535 static const char *__pyx_filename;
536 
537 #if !defined(CYTHON_CCOMPLEX)
538  #if defined(__cplusplus)
539  #define CYTHON_CCOMPLEX 1
540  #elif defined(_Complex_I)
541  #define CYTHON_CCOMPLEX 1
542  #else
543  #define CYTHON_CCOMPLEX 0
544  #endif
545 #endif
546 #if CYTHON_CCOMPLEX
547  #ifdef __cplusplus
548  #include <complex>
549  #else
550  #include <complex.h>
551  #endif
552 #endif
553 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
554  #undef _Complex_I
555  #define _Complex_I 1.0fj
556 #endif
557 
558 
559 static const char *__pyx_f[] = {
560  "freenect.pyx",
561  "__init__.pxd",
562  "type.pxd",
563 };
564 
565 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":723
566  * # in Cython to enable them only on the right systems.
567  *
568  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
569  * ctypedef npy_int16 int16_t
570  * ctypedef npy_int32 int32_t
571  */
572 typedef npy_int8 __pyx_t_5numpy_int8_t;
573 
574 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":724
575  *
576  * ctypedef npy_int8 int8_t
577  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
578  * ctypedef npy_int32 int32_t
579  * ctypedef npy_int64 int64_t
580  */
581 typedef npy_int16 __pyx_t_5numpy_int16_t;
582 
583 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":725
584  * ctypedef npy_int8 int8_t
585  * ctypedef npy_int16 int16_t
586  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
587  * ctypedef npy_int64 int64_t
588  * #ctypedef npy_int96 int96_t
589  */
590 typedef npy_int32 __pyx_t_5numpy_int32_t;
591 
592 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":726
593  * ctypedef npy_int16 int16_t
594  * ctypedef npy_int32 int32_t
595  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
596  * #ctypedef npy_int96 int96_t
597  * #ctypedef npy_int128 int128_t
598  */
599 typedef npy_int64 __pyx_t_5numpy_int64_t;
600 
601 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730
602  * #ctypedef npy_int128 int128_t
603  *
604  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
605  * ctypedef npy_uint16 uint16_t
606  * ctypedef npy_uint32 uint32_t
607  */
608 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
609 
610 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731
611  *
612  * ctypedef npy_uint8 uint8_t
613  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
614  * ctypedef npy_uint32 uint32_t
615  * ctypedef npy_uint64 uint64_t
616  */
617 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
618 
619 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
620  * ctypedef npy_uint8 uint8_t
621  * ctypedef npy_uint16 uint16_t
622  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
623  * ctypedef npy_uint64 uint64_t
624  * #ctypedef npy_uint96 uint96_t
625  */
626 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
627 
628 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
629  * ctypedef npy_uint16 uint16_t
630  * ctypedef npy_uint32 uint32_t
631  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
632  * #ctypedef npy_uint96 uint96_t
633  * #ctypedef npy_uint128 uint128_t
634  */
635 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
636 
637 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737
638  * #ctypedef npy_uint128 uint128_t
639  *
640  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
641  * ctypedef npy_float64 float64_t
642  * #ctypedef npy_float80 float80_t
643  */
644 typedef npy_float32 __pyx_t_5numpy_float32_t;
645 
646 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738
647  *
648  * ctypedef npy_float32 float32_t
649  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
650  * #ctypedef npy_float80 float80_t
651  * #ctypedef npy_float128 float128_t
652  */
653 typedef npy_float64 __pyx_t_5numpy_float64_t;
654 
655 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":747
656  * # The int types are mapped a bit surprising --
657  * # numpy.int corresponds to 'l' and numpy.long to 'q'
658  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
659  * ctypedef npy_longlong long_t
660  * ctypedef npy_longlong longlong_t
661  */
662 typedef npy_long __pyx_t_5numpy_int_t;
663 
664 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":748
665  * # numpy.int corresponds to 'l' and numpy.long to 'q'
666  * ctypedef npy_long int_t
667  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
668  * ctypedef npy_longlong longlong_t
669  *
670  */
671 typedef npy_longlong __pyx_t_5numpy_long_t;
672 
673 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":749
674  * ctypedef npy_long int_t
675  * ctypedef npy_longlong long_t
676  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
677  *
678  * ctypedef npy_ulong uint_t
679  */
680 typedef npy_longlong __pyx_t_5numpy_longlong_t;
681 
682 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":751
683  * ctypedef npy_longlong longlong_t
684  *
685  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
686  * ctypedef npy_ulonglong ulong_t
687  * ctypedef npy_ulonglong ulonglong_t
688  */
689 typedef npy_ulong __pyx_t_5numpy_uint_t;
690 
691 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":752
692  *
693  * ctypedef npy_ulong uint_t
694  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
695  * ctypedef npy_ulonglong ulonglong_t
696  *
697  */
698 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
699 
700 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":753
701  * ctypedef npy_ulong uint_t
702  * ctypedef npy_ulonglong ulong_t
703  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
704  *
705  * ctypedef npy_intp intp_t
706  */
707 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
708 
709 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
710  * ctypedef npy_ulonglong ulonglong_t
711  *
712  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
713  * ctypedef npy_uintp uintp_t
714  *
715  */
716 typedef npy_intp __pyx_t_5numpy_intp_t;
717 
718 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756
719  *
720  * ctypedef npy_intp intp_t
721  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
722  *
723  * ctypedef npy_double float_t
724  */
725 typedef npy_uintp __pyx_t_5numpy_uintp_t;
726 
727 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
728  * ctypedef npy_uintp uintp_t
729  *
730  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
731  * ctypedef npy_double double_t
732  * ctypedef npy_longdouble longdouble_t
733  */
734 typedef npy_double __pyx_t_5numpy_float_t;
735 
736 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759
737  *
738  * ctypedef npy_double float_t
739  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
740  * ctypedef npy_longdouble longdouble_t
741  *
742  */
743 typedef npy_double __pyx_t_5numpy_double_t;
744 
745 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
746  * ctypedef npy_double float_t
747  * ctypedef npy_double double_t
748  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
749  *
750  * ctypedef npy_cfloat cfloat_t
751  */
752 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
753 #if CYTHON_CCOMPLEX
754  #ifdef __cplusplus
755  typedef ::std::complex< float > __pyx_t_float_complex;
756  #else
757  typedef float _Complex __pyx_t_float_complex;
758  #endif
759 #else
760  typedef struct { float real, imag; } __pyx_t_float_complex;
761 #endif
762 
763 #if CYTHON_CCOMPLEX
764  #ifdef __cplusplus
765  typedef ::std::complex< double > __pyx_t_double_complex;
766  #else
767  typedef double _Complex __pyx_t_double_complex;
768  #endif
769 #else
770  typedef struct { double real, imag; } __pyx_t_double_complex;
771 #endif
772 
773 
774 /*--- Type declarations ---*/
775 struct __pyx_obj_8freenect_CtxPtr;
776 struct __pyx_obj_8freenect_DevPtr;
777 struct __pyx_obj_8freenect_StatePtr;
778 
779 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
780  * ctypedef npy_longdouble longdouble_t
781  *
782  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
783  * ctypedef npy_cdouble cdouble_t
784  * ctypedef npy_clongdouble clongdouble_t
785  */
786 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
787 
788 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763
789  *
790  * ctypedef npy_cfloat cfloat_t
791  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
792  * ctypedef npy_clongdouble clongdouble_t
793  *
794  */
795 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
796 
797 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":764
798  * ctypedef npy_cfloat cfloat_t
799  * ctypedef npy_cdouble cdouble_t
800  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
801  *
802  * ctypedef npy_cdouble complex_t
803  */
804 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
805 
806 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
807  * ctypedef npy_clongdouble clongdouble_t
808  *
809  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
810  *
811  * cdef inline object PyArray_MultiIterNew1(a):
812  */
813 typedef npy_cdouble __pyx_t_5numpy_complex_t;
814 
815 /* "freenect.pyx":176
816  * raise TypeError("What kind of system are you using?!")
817  *
818  * cdef class CtxPtr: # <<<<<<<<<<<<<<
819  * cdef freenect_context* _ptr
820  * def __init__(self):
821  */
822 struct __pyx_obj_8freenect_CtxPtr {
823  PyObject_HEAD
824  freenect_context *_ptr;
825 };
826 
827 
828 /* "freenect.pyx":185
829  * return "<Ctx Pointer %s>" % _format_ptr(self._ptr)
830  *
831  * cdef class DevPtr: # <<<<<<<<<<<<<<
832  * cdef freenect_device* _ptr
833  * cdef CtxPtr ctx
834  */
835 struct __pyx_obj_8freenect_DevPtr {
836  PyObject_HEAD
837  freenect_device *_ptr;
838  struct __pyx_obj_8freenect_CtxPtr *ctx;
839 };
840 
841 
842 /* "freenect.pyx":195
843  * return "<Dev Pointer %s>" % _format_ptr(self._ptr)
844  *
845  * cdef class StatePtr: # <<<<<<<<<<<<<<
846  * cdef freenect_raw_tilt_state* _ptr
847  * def __init__(self):
848  */
849 struct __pyx_obj_8freenect_StatePtr {
850  PyObject_HEAD
852 };
853 
854 #ifndef CYTHON_REFNANNY
855  #define CYTHON_REFNANNY 0
856 #endif
857 #if CYTHON_REFNANNY
858  typedef struct {
859  void (*INCREF)(void*, PyObject*, int);
860  void (*DECREF)(void*, PyObject*, int);
861  void (*GOTREF)(void*, PyObject*, int);
862  void (*GIVEREF)(void*, PyObject*, int);
863  void* (*SetupContext)(const char*, int, const char*);
864  void (*FinishContext)(void**);
865  } __Pyx_RefNannyAPIStruct;
866  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
867  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
868  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
869 #ifdef WITH_THREAD
870  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
871  if (acquire_gil) { \
872  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
873  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
874  PyGILState_Release(__pyx_gilstate_save); \
875  } else { \
876  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
877  }
878 #else
879  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
880  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
881 #endif
882  #define __Pyx_RefNannyFinishContext() \
883  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
884  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
885  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
886  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
887  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
888  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
889  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
890  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
891  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
892 #else
893  #define __Pyx_RefNannyDeclarations
894  #define __Pyx_RefNannySetupContext(name, acquire_gil)
895  #define __Pyx_RefNannyFinishContext()
896  #define __Pyx_INCREF(r) Py_INCREF(r)
897  #define __Pyx_DECREF(r) Py_DECREF(r)
898  #define __Pyx_GOTREF(r)
899  #define __Pyx_GIVEREF(r)
900  #define __Pyx_XINCREF(r) Py_XINCREF(r)
901  #define __Pyx_XDECREF(r) Py_XDECREF(r)
902  #define __Pyx_XGOTREF(r)
903  #define __Pyx_XGIVEREF(r)
904 #endif /* CYTHON_REFNANNY */
905 #define __Pyx_XDECREF_SET(r, v) do { \
906  PyObject *tmp = (PyObject *) r; \
907  r = v; __Pyx_XDECREF(tmp); \
908  } while (0)
909 #define __Pyx_DECREF_SET(r, v) do { \
910  PyObject *tmp = (PyObject *) r; \
911  r = v; __Pyx_DECREF(tmp); \
912  } while (0)
913 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
914 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
915 
916 #if CYTHON_COMPILING_IN_CPYTHON
917 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
918  PyTypeObject* tp = Py_TYPE(obj);
919  if (likely(tp->tp_getattro))
920  return tp->tp_getattro(obj, attr_name);
921 #if PY_MAJOR_VERSION < 3
922  if (likely(tp->tp_getattr))
923  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
924 #endif
925  return PyObject_GetAttr(obj, attr_name);
926 }
927 #else
928 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
929 #endif
930 
931 static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
932 
933 #if CYTHON_COMPILING_IN_CPYTHON
934 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
935 #else
936 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
937 #endif
938 
939 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
940 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
941 
942 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
943 
944 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
945  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
946 
947 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/
948 
949 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
950 
951 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
952  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
953  const char* function_name); /*proto*/
954 
955 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
956  const char *name, int exact); /*proto*/
957 
958 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
959 
960 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
961 
962 #ifndef __PYX_FORCE_INIT_THREADS
963  #define __PYX_FORCE_INIT_THREADS 0
964 #endif
965 
966 static void __Pyx_WriteUnraisable(const char *name, int clineno,
967  int lineno, const char *filename,
968  int full_traceback); /*proto*/
969 
970 static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
971 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
972 
973 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
974 
975 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
976 
977 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
978 
979 static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name); /*proto*/
980 
981 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
982 
983 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
984  PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/
985 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
986  PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/
987 
988 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
989 
990 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
991 
992 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value);
993 
994 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value);
995 
996 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
997 
998 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value);
999 
1000 static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/
1001 #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
1002 static PyObject* __pyx_print = 0;
1003 static PyObject* __pyx_print_kwargs = 0;
1004 #endif
1005 
1006 static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/
1007 
1008 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);
1009 
1010 #if CYTHON_CCOMPLEX
1011  #ifdef __cplusplus
1012  #define __Pyx_CREAL(z) ((z).real())
1013  #define __Pyx_CIMAG(z) ((z).imag())
1014  #else
1015  #define __Pyx_CREAL(z) (__real__(z))
1016  #define __Pyx_CIMAG(z) (__imag__(z))
1017  #endif
1018 #else
1019  #define __Pyx_CREAL(z) ((z).real)
1020  #define __Pyx_CIMAG(z) ((z).imag)
1021 #endif
1022 #if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
1023  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1024  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1025 #else
1026  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1027  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1028 #endif
1029 
1030 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1031 
1032 #if CYTHON_CCOMPLEX
1033  #define __Pyx_c_eqf(a, b) ((a)==(b))
1034  #define __Pyx_c_sumf(a, b) ((a)+(b))
1035  #define __Pyx_c_difff(a, b) ((a)-(b))
1036  #define __Pyx_c_prodf(a, b) ((a)*(b))
1037  #define __Pyx_c_quotf(a, b) ((a)/(b))
1038  #define __Pyx_c_negf(a) (-(a))
1039  #ifdef __cplusplus
1040  #define __Pyx_c_is_zerof(z) ((z)==(float)0)
1041  #define __Pyx_c_conjf(z) (::std::conj(z))
1042  #if 1
1043  #define __Pyx_c_absf(z) (::std::abs(z))
1044  #define __Pyx_c_powf(a, b) (::std::pow(a, b))
1045  #endif
1046  #else
1047  #define __Pyx_c_is_zerof(z) ((z)==0)
1048  #define __Pyx_c_conjf(z) (conjf(z))
1049  #if 1
1050  #define __Pyx_c_absf(z) (cabsf(z))
1051  #define __Pyx_c_powf(a, b) (cpowf(a, b))
1052  #endif
1053  #endif
1054 #else
1055  static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
1056  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
1057  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
1058  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
1059  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
1060  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
1061  static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
1062  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
1063  #if 1
1064  static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
1065  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
1066  #endif
1067 #endif
1068 
1069 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1070 
1071 #if CYTHON_CCOMPLEX
1072  #define __Pyx_c_eq(a, b) ((a)==(b))
1073  #define __Pyx_c_sum(a, b) ((a)+(b))
1074  #define __Pyx_c_diff(a, b) ((a)-(b))
1075  #define __Pyx_c_prod(a, b) ((a)*(b))
1076  #define __Pyx_c_quot(a, b) ((a)/(b))
1077  #define __Pyx_c_neg(a) (-(a))
1078  #ifdef __cplusplus
1079  #define __Pyx_c_is_zero(z) ((z)==(double)0)
1080  #define __Pyx_c_conj(z) (::std::conj(z))
1081  #if 1
1082  #define __Pyx_c_abs(z) (::std::abs(z))
1083  #define __Pyx_c_pow(a, b) (::std::pow(a, b))
1084  #endif
1085  #else
1086  #define __Pyx_c_is_zero(z) ((z)==0)
1087  #define __Pyx_c_conj(z) (conj(z))
1088  #if 1
1089  #define __Pyx_c_abs(z) (cabs(z))
1090  #define __Pyx_c_pow(a, b) (cpow(a, b))
1091  #endif
1092  #endif
1093 #else
1094  static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
1095  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
1096  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
1097  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
1098  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
1099  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
1100  static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
1101  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
1102  #if 1
1103  static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
1104  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
1105  #endif
1106 #endif
1107 
1108 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1109 
1110 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1111 
1112 static int __Pyx_check_binary_version(void);
1113 
1114 #if !defined(__Pyx_PyIdentifier_FromString)
1115 #if PY_MAJOR_VERSION < 3
1116  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
1117 #else
1118  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
1119 #endif
1120 #endif
1121 
1122 static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
1123 
1124 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/
1125 
1126 typedef struct {
1127  int code_line;
1128  PyCodeObject* code_object;
1129 } __Pyx_CodeObjectCacheEntry;
1130 struct __Pyx_CodeObjectCache {
1131  int count;
1132  int max_count;
1133  __Pyx_CodeObjectCacheEntry* entries;
1134 };
1135 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1136 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1137 static PyCodeObject *__pyx_find_code_object(int code_line);
1138 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1139 
1140 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1141  int py_line, const char *filename); /*proto*/
1142 
1143 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
1144 
1145 
1146 /* Module declarations from 'libc.stdint' */
1147 
1148 /* Module declarations from 'cpython.buffer' */
1149 
1150 /* Module declarations from 'cpython.ref' */
1151 
1152 /* Module declarations from 'libc.string' */
1153 
1154 /* Module declarations from 'libc.stdio' */
1155 
1156 /* Module declarations from 'cpython.object' */
1157 
1158 /* Module declarations from '__builtin__' */
1159 
1160 /* Module declarations from 'cpython.type' */
1161 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1162 
1163 /* Module declarations from 'libc.stdlib' */
1164 
1165 /* Module declarations from 'numpy' */
1166 
1167 /* Module declarations from 'numpy' */
1168 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1169 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1170 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1171 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1172 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1173 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
1174 
1175 /* Module declarations from 'freenect' */
1176 static PyTypeObject *__pyx_ptype_8freenect_CtxPtr = 0;
1177 static PyTypeObject *__pyx_ptype_8freenect_DevPtr = 0;
1178 static PyTypeObject *__pyx_ptype_8freenect_StatePtr = 0;
1179 static CYTHON_INLINE PyObject *__pyx_f_8freenect__format_ptr(void *); /*proto*/
1180 static PyObject *__pyx_f_8freenect_init(int __pyx_skip_dispatch); /*proto*/
1181 static PyObject *__pyx_f_8freenect_open_device(struct __pyx_obj_8freenect_CtxPtr *, int, int __pyx_skip_dispatch); /*proto*/
1182 static void __pyx_f_8freenect_depth_cb(freenect_device *, void *, uint32_t); /*proto*/
1183 static void __pyx_f_8freenect_video_cb(freenect_device *, void *, uint32_t); /*proto*/
1184 static PyObject *__pyx_f_8freenect__depth_cb_np(void *, freenect_frame_mode *); /*proto*/
1185 static PyObject *__pyx_f_8freenect__video_cb_np(void *, freenect_frame_mode *); /*proto*/
1186 #define __Pyx_MODULE_NAME "freenect"
1187 int __pyx_module_is_main_freenect = 0;
1188 
1189 /* Implementation of 'freenect' */
1190 static PyObject *__pyx_builtin_property;
1191 static PyObject *__pyx_builtin_Exception;
1192 static PyObject *__pyx_builtin_TypeError;
1193 static PyObject *__pyx_builtin_ValueError;
1194 static PyObject *__pyx_builtin_range;
1195 static PyObject *__pyx_builtin_RuntimeError;
1196 static int __pyx_pf_8freenect_6CtxPtr___init__(CYTHON_UNUSED struct __pyx_obj_8freenect_CtxPtr *__pyx_v_self); /* proto */
1197 static PyObject *__pyx_pf_8freenect_6CtxPtr_2__repr__(struct __pyx_obj_8freenect_CtxPtr *__pyx_v_self); /* proto */
1198 static int __pyx_pf_8freenect_6DevPtr___init__(CYTHON_UNUSED struct __pyx_obj_8freenect_DevPtr *__pyx_v_self); /* proto */
1199 static PyObject *__pyx_pf_8freenect_6DevPtr_2__repr__(struct __pyx_obj_8freenect_DevPtr *__pyx_v_self); /* proto */
1200 static int __pyx_pf_8freenect_8StatePtr___init__(CYTHON_UNUSED struct __pyx_obj_8freenect_StatePtr *__pyx_v_self); /* proto */
1201 static PyObject *__pyx_pf_8freenect_8StatePtr_2__repr__(struct __pyx_obj_8freenect_StatePtr *__pyx_v_self); /* proto */
1202 static PyObject *__pyx_pf_8freenect_8StatePtr_4_get_accelx(struct __pyx_obj_8freenect_StatePtr *__pyx_v_self); /* proto */
1203 static PyObject *__pyx_pf_8freenect_8StatePtr_6_get_accely(struct __pyx_obj_8freenect_StatePtr *__pyx_v_self); /* proto */
1204 static PyObject *__pyx_pf_8freenect_8StatePtr_8_get_accelz(struct __pyx_obj_8freenect_StatePtr *__pyx_v_self); /* proto */
1205 static PyObject *__pyx_pf_8freenect_8StatePtr_10_get_tilt_angle(struct __pyx_obj_8freenect_StatePtr *__pyx_v_self); /* proto */
1206 static PyObject *__pyx_pf_8freenect_8StatePtr_12_get_tilt_status(struct __pyx_obj_8freenect_StatePtr *__pyx_v_self); /* proto */
1207 static PyObject *__pyx_pf_8freenect_set_depth_mode(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev, int __pyx_v_res, int __pyx_v_mode); /* proto */
1208 static PyObject *__pyx_pf_8freenect_2set_video_mode(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev, int __pyx_v_res, int __pyx_v_mode); /* proto */
1209 static PyObject *__pyx_pf_8freenect_4get_depth_format(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev); /* proto */
1210 static PyObject *__pyx_pf_8freenect_6get_video_format(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev); /* proto */
1211 static PyObject *__pyx_pf_8freenect_8start_depth(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev); /* proto */
1212 static PyObject *__pyx_pf_8freenect_10start_video(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev); /* proto */
1213 static PyObject *__pyx_pf_8freenect_12stop_depth(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev); /* proto */
1214 static PyObject *__pyx_pf_8freenect_14stop_video(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev); /* proto */
1215 static PyObject *__pyx_pf_8freenect_16shutdown(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx); /* proto */
1216 static PyObject *__pyx_pf_8freenect_18process_events(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx); /* proto */
1217 static PyObject *__pyx_pf_8freenect_20num_devices(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx); /* proto */
1218 static PyObject *__pyx_pf_8freenect_22close_device(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev); /* proto */
1219 static PyObject *__pyx_pf_8freenect_24set_tilt_degs(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev, float __pyx_v_angle); /* proto */
1220 static PyObject *__pyx_pf_8freenect_26set_led(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev, freenect_led_options __pyx_v_option); /* proto */
1221 static PyObject *__pyx_pf_8freenect_28update_tilt_state(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev); /* proto */
1222 static PyObject *__pyx_pf_8freenect_30get_tilt_state(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev); /* proto */
1223 static PyObject *__pyx_pf_8freenect_32get_mks_accel(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_StatePtr *__pyx_v_state); /* proto */
1224 static PyObject *__pyx_pf_8freenect_34get_accel(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev); /* proto */
1225 static PyObject *__pyx_pf_8freenect_36get_tilt_degs(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_StatePtr *__pyx_v_state); /* proto */
1226 static PyObject *__pyx_pf_8freenect_38error_open_device(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
1227 static PyObject *__pyx_pf_8freenect_40init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
1228 static PyObject *__pyx_pf_8freenect_42open_device(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx, int __pyx_v_index); /* proto */
1229 static PyObject *__pyx_pf_8freenect_44set_depth_callback(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev, PyObject *__pyx_v_cb); /* proto */
1230 static PyObject *__pyx_pf_8freenect_46set_video_callback(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev, PyObject *__pyx_v_cb); /* proto */
1231 static PyObject *__pyx_pf_8freenect_48runloop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_depth, PyObject *__pyx_v_video, PyObject *__pyx_v_body, PyObject *__pyx_v_dev); /* proto */
1232 static PyObject *__pyx_pf_8freenect_50base_runloop(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx, PyObject *__pyx_v_body); /* proto */
1233 static PyObject *__pyx_pf_8freenect_52sync_get_depth(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index, PyObject *__pyx_v_format); /* proto */
1234 static PyObject *__pyx_pf_8freenect_54sync_get_video(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index, PyObject *__pyx_v_format); /* proto */
1235 static PyObject *__pyx_pf_8freenect_56sync_stop(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
1236 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
1237 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
1238 static PyObject *__pyx_tp_new_8freenect_CtxPtr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1239 static PyObject *__pyx_tp_new_8freenect_DevPtr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1240 static PyObject *__pyx_tp_new_8freenect_StatePtr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1241 static char __pyx_k_B[] = "B";
1242 static char __pyx_k_H[] = "H";
1243 static char __pyx_k_I[] = "I";
1244 static char __pyx_k_L[] = "L";
1245 static char __pyx_k_O[] = "O";
1246 static char __pyx_k_Q[] = "Q";
1247 static char __pyx_k_b[] = "b";
1248 static char __pyx_k_d[] = "d";
1249 static char __pyx_k_f[] = "f";
1250 static char __pyx_k_g[] = "g";
1251 static char __pyx_k_h[] = "h";
1252 static char __pyx_k_i[] = "i";
1253 static char __pyx_k_l[] = "l";
1254 static char __pyx_k_q[] = "q";
1255 static char __pyx_k_x[] = "x";
1256 static char __pyx_k_y[] = "y";
1257 static char __pyx_k_z[] = "z";
1258 static char __pyx_k_Zd[] = "Zd";
1259 static char __pyx_k_Zf[] = "Zf";
1260 static char __pyx_k_Zg[] = "Zg";
1261 static char __pyx_k_cb[] = "cb";
1262 static char __pyx_k_np[] = "np";
1263 static char __pyx_k_ctx[] = "ctx";
1264 static char __pyx_k_dev[] = "dev";
1265 static char __pyx_k_doc[] = "__doc__";
1266 static char __pyx_k_end[] = "end";
1267 static char __pyx_k_out[] = "out";
1268 static char __pyx_k_res[] = "res";
1269 static char __pyx_k_Kill[] = "Kill";
1270 static char __pyx_k_body[] = "body";
1271 static char __pyx_k_ctxp[] = "ctxp";
1272 static char __pyx_k_data[] = "data";
1273 static char __pyx_k_devp[] = "devp";
1274 static char __pyx_k_dims[] = "dims";
1275 static char __pyx_k_file[] = "file";
1276 static char __pyx_k_main[] = "__main__";
1277 static char __pyx_k_mdev[] = "mdev";
1278 static char __pyx_k_mode[] = "mode";
1279 static char __pyx_k_test[] = "__test__";
1280 static char __pyx_k_angle[] = "angle";
1281 static char __pyx_k_depth[] = "depth";
1282 static char __pyx_k_index[] = "index";
1283 static char __pyx_k_numpy[] = "numpy";
1284 static char __pyx_k_print[] = "print";
1285 static char __pyx_k_range[] = "range";
1286 static char __pyx_k_state[] = "state";
1287 static char __pyx_k_video[] = "video";
1288 static char __pyx_k_0x_08x[] = "0x%08x";
1289 static char __pyx_k_format[] = "format";
1290 static char __pyx_k_import[] = "__import__";
1291 static char __pyx_k_module[] = "__module__";
1292 static char __pyx_k_option[] = "option";
1293 static char __pyx_k_0x_016x[] = "0x%016x";
1294 static char __pyx_k_LED_OFF[] = "LED_OFF";
1295 static char __pyx_k_LED_RED[] = "LED_RED";
1296 static char __pyx_k_index_2[] = "_index";
1297 static char __pyx_k_prepare[] = "__prepare__";
1298 static char __pyx_k_runloop[] = "runloop";
1299 static char __pyx_k_set_led[] = "set_led";
1300 static char __pyx_k_DEPTH_MM[] = "DEPTH_MM";
1301 static char __pyx_k_depth_cb[] = "_depth_cb";
1302 static char __pyx_k_format_2[] = "_format";
1303 static char __pyx_k_freenect[] = "freenect";
1304 static char __pyx_k_property[] = "property";
1305 static char __pyx_k_qualname[] = "__qualname__";
1306 static char __pyx_k_shutdown[] = "shutdown";
1307 static char __pyx_k_video_cb[] = "_video_cb";
1308 static char __pyx_k_Exception[] = "Exception";
1309 static char __pyx_k_LED_GREEN[] = "LED_GREEN";
1310 static char __pyx_k_TypeError[] = "TypeError";
1311 static char __pyx_k_VIDEO_RGB[] = "VIDEO_RGB";
1312 static char __pyx_k_get_accel[] = "get_accel";
1313 static char __pyx_k_metaclass[] = "__metaclass__";
1314 static char __pyx_k_state_out[] = "state_out";
1315 static char __pyx_k_sync_stop[] = "sync_stop";
1316 static char __pyx_k_timestamp[] = "timestamp";
1317 static char __pyx_k_LED_YELLOW[] = "LED_YELLOW";
1318 static char __pyx_k_ValueError[] = "ValueError";
1319 static char __pyx_k_get_accelx[] = "_get_accelx";
1320 static char __pyx_k_get_accely[] = "_get_accely";
1321 static char __pyx_k_get_accelz[] = "_get_accelz";
1322 static char __pyx_k_stop_depth[] = "stop_depth";
1323 static char __pyx_k_stop_video[] = "stop_video";
1324 static char __pyx_k_tilt_angle[] = "tilt_angle";
1325 static char __pyx_k_DEPTH_10BIT[] = "DEPTH_10BIT";
1326 static char __pyx_k_DEPTH_11BIT[] = "DEPTH_11BIT";
1327 static char __pyx_k_VIDEO_BAYER[] = "VIDEO_BAYER";
1328 static char __pyx_k_num_devices[] = "num_devices";
1329 static char __pyx_k_start_depth[] = "start_depth";
1330 static char __pyx_k_start_video[] = "start_video";
1331 static char __pyx_k_tilt_status[] = "tilt_status";
1332 static char __pyx_k_DEVICE_AUDIO[] = "DEVICE_AUDIO";
1333 static char __pyx_k_DEVICE_MOTOR[] = "DEVICE_MOTOR";
1334 static char __pyx_k_RuntimeError[] = "RuntimeError";
1335 static char __pyx_k_base_runloop[] = "base_runloop";
1336 static char __pyx_k_close_device[] = "close_device";
1337 static char __pyx_k_freenect_pyx[] = "freenect.pyx";
1338 static char __pyx_k_Ctx_Pointer_s[] = "<Ctx Pointer %s>";
1339 static char __pyx_k_DEVICE_CAMERA[] = "DEVICE_CAMERA";
1340 static char __pyx_k_Dev_Pointer_s[] = "<Dev Pointer %s>";
1341 static char __pyx_k_VIDEO_IR_8BIT[] = "VIDEO_IR_8BIT";
1342 static char __pyx_k_VIDEO_YUV_RAW[] = "VIDEO_YUV_RAW";
1343 static char __pyx_k_VIDEO_YUV_RGB[] = "VIDEO_YUV_RGB";
1344 static char __pyx_k_get_mks_accel[] = "get_mks_accel";
1345 static char __pyx_k_get_tilt_degs[] = "get_tilt_degs";
1346 static char __pyx_k_set_tilt_degs[] = "set_tilt_degs";
1347 static char __pyx_k_RESOLUTION_LOW[] = "RESOLUTION_LOW";
1348 static char __pyx_k_VIDEO_IR_10BIT[] = "VIDEO_IR_10BIT";
1349 static char __pyx_k_get_tilt_angle[] = "_get_tilt_angle";
1350 static char __pyx_k_get_tilt_state[] = "get_tilt_state";
1351 static char __pyx_k_process_events[] = "process_events";
1352 static char __pyx_k_set_depth_mode[] = "set_depth_mode";
1353 static char __pyx_k_set_video_mode[] = "set_video_mode";
1354 static char __pyx_k_sync_get_depth[] = "sync_get_depth";
1355 static char __pyx_k_sync_get_video[] = "sync_get_video";
1356 static char __pyx_k_LED_BLINK_GREEN[] = "LED_BLINK_GREEN";
1357 static char __pyx_k_RESOLUTION_HIGH[] = "RESOLUTION_HIGH";
1358 static char __pyx_k_State_Pointer_s[] = "<State Pointer %s>";
1359 static char __pyx_k_accelerometer_x[] = "accelerometer_x";
1360 static char __pyx_k_accelerometer_y[] = "accelerometer_y";
1361 static char __pyx_k_accelerometer_z[] = "accelerometer_z";
1362 static char __pyx_k_get_tilt_status[] = "_get_tilt_status";
1363 static char __pyx_k_DEPTH_REGISTERED[] = "DEPTH_REGISTERED";
1364 static char __pyx_k_get_depth_format[] = "get_depth_format";
1365 static char __pyx_k_get_video_format[] = "get_video_format";
1366 static char __pyx_k_RESOLUTION_MEDIUM[] = "RESOLUTION_MEDIUM";
1367 static char __pyx_k_error_open_device[] = "error_open_device";
1368 static char __pyx_k_update_tilt_state[] = "update_tilt_state";
1369 static char __pyx_k_DEPTH_10BIT_PACKED[] = "DEPTH_10BIT_PACKED";
1370 static char __pyx_k_DEPTH_11BIT_PACKED[] = "DEPTH_11BIT_PACKED";
1371 static char __pyx_k_set_depth_callback[] = "set_depth_callback";
1372 static char __pyx_k_set_video_callback[] = "set_video_callback";
1373 static char __pyx_k_LED_BLINK_RED_YELLOW[] = "LED_BLINK_RED_YELLOW";
1374 static char __pyx_k_VIDEO_IR_10BIT_PACKED[] = "VIDEO_IR_10BIT_PACKED";
1375 static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
1376 static char __pyx_k_Error_Can_t_open_device_1_is_it[] = "Error: Can't open device. 1.) is it plugged in? 2.) Read the README";
1377 static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
1378 static char __pyx_k_Cannot_create_instances_of_CtxPt[] = "Cannot create instances of CtxPtr from Python";
1379 static char __pyx_k_Cannot_create_instances_of_DevPt[] = "Cannot create instances of DevPtr from Python";
1380 static char __pyx_k_Cannot_create_instances_of_State[] = "Cannot create instances of StatePtr from Python";
1381 static char __pyx_k_Conversion_not_implemented_for_t[] = "Conversion not implemented for type [%d]";
1382 static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
1383 static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
1384 static char __pyx_k_This_kills_the_runloop_raise_fro[] = "This kills the runloop, raise from the body only";
1385 static char __pyx_k_What_kind_of_system_are_you_usin[] = "What kind of system are you using?!";
1386 static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
1387 static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
1388 static PyObject *__pyx_kp_s_0x_016x;
1389 static PyObject *__pyx_kp_s_0x_08x;
1390 static PyObject *__pyx_kp_s_Cannot_create_instances_of_CtxPt;
1391 static PyObject *__pyx_kp_s_Cannot_create_instances_of_DevPt;
1392 static PyObject *__pyx_kp_s_Cannot_create_instances_of_State;
1393 static PyObject *__pyx_kp_s_Conversion_not_implemented_for_t;
1394 static PyObject *__pyx_kp_s_Ctx_Pointer_s;
1395 static PyObject *__pyx_n_s_DEPTH_10BIT;
1396 static PyObject *__pyx_n_s_DEPTH_10BIT_PACKED;
1397 static PyObject *__pyx_n_s_DEPTH_11BIT;
1398 static PyObject *__pyx_n_s_DEPTH_11BIT_PACKED;
1399 static PyObject *__pyx_n_s_DEPTH_MM;
1400 static PyObject *__pyx_n_s_DEPTH_REGISTERED;
1401 static PyObject *__pyx_n_s_DEVICE_AUDIO;
1402 static PyObject *__pyx_n_s_DEVICE_CAMERA;
1403 static PyObject *__pyx_n_s_DEVICE_MOTOR;
1404 static PyObject *__pyx_kp_s_Dev_Pointer_s;
1405 static PyObject *__pyx_kp_s_Error_Can_t_open_device_1_is_it;
1406 static PyObject *__pyx_n_s_Exception;
1407 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
1408 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
1409 static PyObject *__pyx_n_s_Kill;
1410 static PyObject *__pyx_n_s_LED_BLINK_GREEN;
1411 static PyObject *__pyx_n_s_LED_BLINK_RED_YELLOW;
1412 static PyObject *__pyx_n_s_LED_GREEN;
1413 static PyObject *__pyx_n_s_LED_OFF;
1414 static PyObject *__pyx_n_s_LED_RED;
1415 static PyObject *__pyx_n_s_LED_YELLOW;
1416 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
1417 static PyObject *__pyx_n_s_RESOLUTION_HIGH;
1418 static PyObject *__pyx_n_s_RESOLUTION_LOW;
1419 static PyObject *__pyx_n_s_RESOLUTION_MEDIUM;
1420 static PyObject *__pyx_n_s_RuntimeError;
1421 static PyObject *__pyx_kp_s_State_Pointer_s;
1422 static PyObject *__pyx_kp_s_This_kills_the_runloop_raise_fro;
1423 static PyObject *__pyx_n_s_TypeError;
1424 static PyObject *__pyx_n_s_VIDEO_BAYER;
1425 static PyObject *__pyx_n_s_VIDEO_IR_10BIT;
1426 static PyObject *__pyx_n_s_VIDEO_IR_10BIT_PACKED;
1427 static PyObject *__pyx_n_s_VIDEO_IR_8BIT;
1428 static PyObject *__pyx_n_s_VIDEO_RGB;
1429 static PyObject *__pyx_n_s_VIDEO_YUV_RAW;
1430 static PyObject *__pyx_n_s_VIDEO_YUV_RGB;
1431 static PyObject *__pyx_n_s_ValueError;
1432 static PyObject *__pyx_kp_s_What_kind_of_system_are_you_usin;
1433 static PyObject *__pyx_n_s_accelerometer_x;
1434 static PyObject *__pyx_n_s_accelerometer_y;
1435 static PyObject *__pyx_n_s_accelerometer_z;
1436 static PyObject *__pyx_n_s_angle;
1437 static PyObject *__pyx_n_s_base_runloop;
1438 static PyObject *__pyx_n_s_body;
1439 static PyObject *__pyx_n_s_cb;
1440 static PyObject *__pyx_n_s_close_device;
1441 static PyObject *__pyx_n_s_ctx;
1442 static PyObject *__pyx_n_s_ctxp;
1443 static PyObject *__pyx_n_s_data;
1444 static PyObject *__pyx_n_s_depth;
1445 static PyObject *__pyx_n_s_depth_cb;
1446 static PyObject *__pyx_n_s_dev;
1447 static PyObject *__pyx_n_s_devp;
1448 static PyObject *__pyx_n_s_dims;
1449 static PyObject *__pyx_n_s_doc;
1450 static PyObject *__pyx_n_s_end;
1451 static PyObject *__pyx_n_s_error_open_device;
1452 static PyObject *__pyx_n_s_file;
1453 static PyObject *__pyx_n_s_format;
1454 static PyObject *__pyx_n_s_format_2;
1455 static PyObject *__pyx_n_s_freenect;
1456 static PyObject *__pyx_kp_s_freenect_pyx;
1457 static PyObject *__pyx_n_s_get_accel;
1458 static PyObject *__pyx_n_s_get_accelx;
1459 static PyObject *__pyx_n_s_get_accely;
1460 static PyObject *__pyx_n_s_get_accelz;
1461 static PyObject *__pyx_n_s_get_depth_format;
1462 static PyObject *__pyx_n_s_get_mks_accel;
1463 static PyObject *__pyx_n_s_get_tilt_angle;
1464 static PyObject *__pyx_n_s_get_tilt_degs;
1465 static PyObject *__pyx_n_s_get_tilt_state;
1466 static PyObject *__pyx_n_s_get_tilt_status;
1467 static PyObject *__pyx_n_s_get_video_format;
1468 static PyObject *__pyx_n_s_import;
1469 static PyObject *__pyx_n_s_index;
1470 static PyObject *__pyx_n_s_index_2;
1471 static PyObject *__pyx_n_s_main;
1472 static PyObject *__pyx_n_s_mdev;
1473 static PyObject *__pyx_n_s_metaclass;
1474 static PyObject *__pyx_n_s_mode;
1475 static PyObject *__pyx_n_s_module;
1476 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
1477 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
1478 static PyObject *__pyx_n_s_np;
1479 static PyObject *__pyx_n_s_num_devices;
1480 static PyObject *__pyx_n_s_numpy;
1481 static PyObject *__pyx_n_s_option;
1482 static PyObject *__pyx_n_s_out;
1483 static PyObject *__pyx_n_s_prepare;
1484 static PyObject *__pyx_n_s_print;
1485 static PyObject *__pyx_n_s_process_events;
1486 static PyObject *__pyx_n_s_property;
1487 static PyObject *__pyx_n_s_qualname;
1488 static PyObject *__pyx_n_s_range;
1489 static PyObject *__pyx_n_s_res;
1490 static PyObject *__pyx_n_s_runloop;
1491 static PyObject *__pyx_n_s_set_depth_callback;
1492 static PyObject *__pyx_n_s_set_depth_mode;
1493 static PyObject *__pyx_n_s_set_led;
1494 static PyObject *__pyx_n_s_set_tilt_degs;
1495 static PyObject *__pyx_n_s_set_video_callback;
1496 static PyObject *__pyx_n_s_set_video_mode;
1497 static PyObject *__pyx_n_s_shutdown;
1498 static PyObject *__pyx_n_s_start_depth;
1499 static PyObject *__pyx_n_s_start_video;
1500 static PyObject *__pyx_n_s_state;
1501 static PyObject *__pyx_n_s_state_out;
1502 static PyObject *__pyx_n_s_stop_depth;
1503 static PyObject *__pyx_n_s_stop_video;
1504 static PyObject *__pyx_n_s_sync_get_depth;
1505 static PyObject *__pyx_n_s_sync_get_video;
1506 static PyObject *__pyx_n_s_sync_stop;
1507 static PyObject *__pyx_n_s_test;
1508 static PyObject *__pyx_n_s_tilt_angle;
1509 static PyObject *__pyx_n_s_tilt_status;
1510 static PyObject *__pyx_n_s_timestamp;
1511 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
1512 static PyObject *__pyx_n_s_update_tilt_state;
1513 static PyObject *__pyx_n_s_video;
1514 static PyObject *__pyx_n_s_video_cb;
1515 static PyObject *__pyx_n_s_x;
1516 static PyObject *__pyx_n_s_y;
1517 static PyObject *__pyx_n_s_z;
1518 static PyObject *__pyx_int_0;
1519 static PyObject *__pyx_k__5;
1520 static PyObject *__pyx_k__6;
1521 static PyObject *__pyx_tuple_;
1522 static PyObject *__pyx_tuple__2;
1523 static PyObject *__pyx_tuple__3;
1524 static PyObject *__pyx_tuple__4;
1525 static PyObject *__pyx_tuple__7;
1526 static PyObject *__pyx_tuple__8;
1527 static PyObject *__pyx_tuple__9;
1528 static PyObject *__pyx_tuple__10;
1529 static PyObject *__pyx_tuple__11;
1530 static PyObject *__pyx_tuple__12;
1531 static PyObject *__pyx_tuple__13;
1532 static PyObject *__pyx_tuple__15;
1533 static PyObject *__pyx_tuple__17;
1534 static PyObject *__pyx_tuple__19;
1535 static PyObject *__pyx_tuple__21;
1536 static PyObject *__pyx_tuple__23;
1537 static PyObject *__pyx_tuple__25;
1538 static PyObject *__pyx_tuple__27;
1539 static PyObject *__pyx_tuple__29;
1540 static PyObject *__pyx_tuple__31;
1541 static PyObject *__pyx_tuple__33;
1542 static PyObject *__pyx_tuple__35;
1543 static PyObject *__pyx_tuple__37;
1544 static PyObject *__pyx_tuple__39;
1545 static PyObject *__pyx_tuple__41;
1546 static PyObject *__pyx_tuple__43;
1547 static PyObject *__pyx_tuple__45;
1548 static PyObject *__pyx_tuple__47;
1549 static PyObject *__pyx_tuple__49;
1550 static PyObject *__pyx_tuple__52;
1551 static PyObject *__pyx_tuple__54;
1552 static PyObject *__pyx_tuple__56;
1553 static PyObject *__pyx_tuple__58;
1554 static PyObject *__pyx_tuple__60;
1555 static PyObject *__pyx_tuple__62;
1556 static PyObject *__pyx_codeobj__14;
1557 static PyObject *__pyx_codeobj__16;
1558 static PyObject *__pyx_codeobj__18;
1559 static PyObject *__pyx_codeobj__20;
1560 static PyObject *__pyx_codeobj__22;
1561 static PyObject *__pyx_codeobj__24;
1562 static PyObject *__pyx_codeobj__26;
1563 static PyObject *__pyx_codeobj__28;
1564 static PyObject *__pyx_codeobj__30;
1565 static PyObject *__pyx_codeobj__32;
1566 static PyObject *__pyx_codeobj__34;
1567 static PyObject *__pyx_codeobj__36;
1568 static PyObject *__pyx_codeobj__38;
1569 static PyObject *__pyx_codeobj__40;
1570 static PyObject *__pyx_codeobj__42;
1571 static PyObject *__pyx_codeobj__44;
1572 static PyObject *__pyx_codeobj__46;
1573 static PyObject *__pyx_codeobj__48;
1574 static PyObject *__pyx_codeobj__50;
1575 static PyObject *__pyx_codeobj__51;
1576 static PyObject *__pyx_codeobj__53;
1577 static PyObject *__pyx_codeobj__55;
1578 static PyObject *__pyx_codeobj__57;
1579 static PyObject *__pyx_codeobj__59;
1580 static PyObject *__pyx_codeobj__61;
1581 static PyObject *__pyx_codeobj__63;
1582 static PyObject *__pyx_codeobj__64;
1583 
1584 /* "freenect.pyx":168
1585  * DEVICE_AUDIO = FREENECT_DEVICE_AUDIO
1586  *
1587  * cdef inline str _format_ptr(void *ptr): # <<<<<<<<<<<<<<
1588  * if sizeof(void *) == 4:
1589  * return "0x%08x" % <Py_ssize_t>ptr
1590  */
1591 
1592 static CYTHON_INLINE PyObject *__pyx_f_8freenect__format_ptr(void *__pyx_v_ptr) {
1593  PyObject *__pyx_r = NULL;
1594  __Pyx_RefNannyDeclarations
1595  int __pyx_t_1;
1596  PyObject *__pyx_t_2 = NULL;
1597  PyObject *__pyx_t_3 = NULL;
1598  int __pyx_lineno = 0;
1599  const char *__pyx_filename = NULL;
1600  int __pyx_clineno = 0;
1601  __Pyx_RefNannySetupContext("_format_ptr", 0);
1602 
1603  /* "freenect.pyx":169
1604  *
1605  * cdef inline str _format_ptr(void *ptr):
1606  * if sizeof(void *) == 4: # <<<<<<<<<<<<<<
1607  * return "0x%08x" % <Py_ssize_t>ptr
1608  * elif sizeof(void *) == 8:
1609  */
1610  __pyx_t_1 = (((sizeof(void *)) == 4) != 0);
1611  if (__pyx_t_1) {
1612 
1613  /* "freenect.pyx":170
1614  * cdef inline str _format_ptr(void *ptr):
1615  * if sizeof(void *) == 4:
1616  * return "0x%08x" % <Py_ssize_t>ptr # <<<<<<<<<<<<<<
1617  * elif sizeof(void *) == 8:
1618  * return "0x%016x" % <Py_ssize_t>ptr
1619  */
1620  __Pyx_XDECREF(__pyx_r);
1621  __pyx_t_2 = PyInt_FromSsize_t(((Py_ssize_t)__pyx_v_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1622  __Pyx_GOTREF(__pyx_t_2);
1623  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_0x_08x, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1624  __Pyx_GOTREF(__pyx_t_3);
1625  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1626  if (!(likely(PyString_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1627  __pyx_r = ((PyObject*)__pyx_t_3);
1628  __pyx_t_3 = 0;
1629  goto __pyx_L0;
1630  }
1631 
1632  /* "freenect.pyx":171
1633  * if sizeof(void *) == 4:
1634  * return "0x%08x" % <Py_ssize_t>ptr
1635  * elif sizeof(void *) == 8: # <<<<<<<<<<<<<<
1636  * return "0x%016x" % <Py_ssize_t>ptr
1637  * else:
1638  */
1639  __pyx_t_1 = (((sizeof(void *)) == 8) != 0);
1640  if (__pyx_t_1) {
1641 
1642  /* "freenect.pyx":172
1643  * return "0x%08x" % <Py_ssize_t>ptr
1644  * elif sizeof(void *) == 8:
1645  * return "0x%016x" % <Py_ssize_t>ptr # <<<<<<<<<<<<<<
1646  * else:
1647  * raise TypeError("What kind of system are you using?!")
1648  */
1649  __Pyx_XDECREF(__pyx_r);
1650  __pyx_t_3 = PyInt_FromSsize_t(((Py_ssize_t)__pyx_v_ptr)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1651  __Pyx_GOTREF(__pyx_t_3);
1652  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_0x_016x, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1653  __Pyx_GOTREF(__pyx_t_2);
1654  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1655  if (!(likely(PyString_CheckExact(__pyx_t_2))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1656  __pyx_r = ((PyObject*)__pyx_t_2);
1657  __pyx_t_2 = 0;
1658  goto __pyx_L0;
1659  }
1660  /*else*/ {
1661 
1662  /* "freenect.pyx":174
1663  * return "0x%016x" % <Py_ssize_t>ptr
1664  * else:
1665  * raise TypeError("What kind of system are you using?!") # <<<<<<<<<<<<<<
1666  *
1667  * cdef class CtxPtr:
1668  */
1669  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1670  __Pyx_GOTREF(__pyx_t_2);
1671  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1672  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1673  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1674  }
1675 
1676  /* "freenect.pyx":168
1677  * DEVICE_AUDIO = FREENECT_DEVICE_AUDIO
1678  *
1679  * cdef inline str _format_ptr(void *ptr): # <<<<<<<<<<<<<<
1680  * if sizeof(void *) == 4:
1681  * return "0x%08x" % <Py_ssize_t>ptr
1682  */
1683 
1684  /* function exit code */
1685  __pyx_L1_error:;
1686  __Pyx_XDECREF(__pyx_t_2);
1687  __Pyx_XDECREF(__pyx_t_3);
1688  __Pyx_AddTraceback("freenect._format_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
1689  __pyx_r = 0;
1690  __pyx_L0:;
1691  __Pyx_XGIVEREF(__pyx_r);
1692  __Pyx_RefNannyFinishContext();
1693  return __pyx_r;
1694 }
1695 
1696 /* "freenect.pyx":178
1697  * cdef class CtxPtr:
1698  * cdef freenect_context* _ptr
1699  * def __init__(self): # <<<<<<<<<<<<<<
1700  * # Safety: do not allow Python to create instances as they would be NULL
1701  * raise TypeError("Cannot create instances of CtxPtr from Python")
1702  */
1703 
1704 /* Python wrapper */
1705 static int __pyx_pw_8freenect_6CtxPtr_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1706 static int __pyx_pw_8freenect_6CtxPtr_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1707  int __pyx_r;
1708  __Pyx_RefNannyDeclarations
1709  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
1710  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
1711  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
1712  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
1713  __pyx_r = __pyx_pf_8freenect_6CtxPtr___init__(((struct __pyx_obj_8freenect_CtxPtr *)__pyx_v_self));
1714 
1715  /* function exit code */
1716  __Pyx_RefNannyFinishContext();
1717  return __pyx_r;
1718 }
1719 
1720 static int __pyx_pf_8freenect_6CtxPtr___init__(CYTHON_UNUSED struct __pyx_obj_8freenect_CtxPtr *__pyx_v_self) {
1721  int __pyx_r;
1722  __Pyx_RefNannyDeclarations
1723  PyObject *__pyx_t_1 = NULL;
1724  int __pyx_lineno = 0;
1725  const char *__pyx_filename = NULL;
1726  int __pyx_clineno = 0;
1727  __Pyx_RefNannySetupContext("__init__", 0);
1728 
1729  /* "freenect.pyx":180
1730  * def __init__(self):
1731  * # Safety: do not allow Python to create instances as they would be NULL
1732  * raise TypeError("Cannot create instances of CtxPtr from Python") # <<<<<<<<<<<<<<
1733  *
1734  * def __repr__(self):
1735  */
1736  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1737  __Pyx_GOTREF(__pyx_t_1);
1738  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
1739  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1740  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1741 
1742  /* "freenect.pyx":178
1743  * cdef class CtxPtr:
1744  * cdef freenect_context* _ptr
1745  * def __init__(self): # <<<<<<<<<<<<<<
1746  * # Safety: do not allow Python to create instances as they would be NULL
1747  * raise TypeError("Cannot create instances of CtxPtr from Python")
1748  */
1749 
1750  /* function exit code */
1751  __pyx_L1_error:;
1752  __Pyx_XDECREF(__pyx_t_1);
1753  __Pyx_AddTraceback("freenect.CtxPtr.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1754  __pyx_r = -1;
1755  __Pyx_RefNannyFinishContext();
1756  return __pyx_r;
1757 }
1758 
1759 /* "freenect.pyx":182
1760  * raise TypeError("Cannot create instances of CtxPtr from Python")
1761  *
1762  * def __repr__(self): # <<<<<<<<<<<<<<
1763  * return "<Ctx Pointer %s>" % _format_ptr(self._ptr)
1764  *
1765  */
1766 
1767 /* Python wrapper */
1768 static PyObject *__pyx_pw_8freenect_6CtxPtr_3__repr__(PyObject *__pyx_v_self); /*proto*/
1769 static PyObject *__pyx_pw_8freenect_6CtxPtr_3__repr__(PyObject *__pyx_v_self) {
1770  PyObject *__pyx_r = 0;
1771  __Pyx_RefNannyDeclarations
1772  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
1773  __pyx_r = __pyx_pf_8freenect_6CtxPtr_2__repr__(((struct __pyx_obj_8freenect_CtxPtr *)__pyx_v_self));
1774 
1775  /* function exit code */
1776  __Pyx_RefNannyFinishContext();
1777  return __pyx_r;
1778 }
1779 
1780 static PyObject *__pyx_pf_8freenect_6CtxPtr_2__repr__(struct __pyx_obj_8freenect_CtxPtr *__pyx_v_self) {
1781  PyObject *__pyx_r = NULL;
1782  __Pyx_RefNannyDeclarations
1783  PyObject *__pyx_t_1 = NULL;
1784  PyObject *__pyx_t_2 = NULL;
1785  int __pyx_lineno = 0;
1786  const char *__pyx_filename = NULL;
1787  int __pyx_clineno = 0;
1788  __Pyx_RefNannySetupContext("__repr__", 0);
1789 
1790  /* "freenect.pyx":183
1791  *
1792  * def __repr__(self):
1793  * return "<Ctx Pointer %s>" % _format_ptr(self._ptr) # <<<<<<<<<<<<<<
1794  *
1795  * cdef class DevPtr:
1796  */
1797  __Pyx_XDECREF(__pyx_r);
1798  __pyx_t_1 = __pyx_f_8freenect__format_ptr(__pyx_v_self->_ptr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1799  __Pyx_GOTREF(__pyx_t_1);
1800  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Ctx_Pointer_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1801  __Pyx_GOTREF(__pyx_t_2);
1802  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1803  __pyx_r = __pyx_t_2;
1804  __pyx_t_2 = 0;
1805  goto __pyx_L0;
1806 
1807  /* "freenect.pyx":182
1808  * raise TypeError("Cannot create instances of CtxPtr from Python")
1809  *
1810  * def __repr__(self): # <<<<<<<<<<<<<<
1811  * return "<Ctx Pointer %s>" % _format_ptr(self._ptr)
1812  *
1813  */
1814 
1815  /* function exit code */
1816  __pyx_L1_error:;
1817  __Pyx_XDECREF(__pyx_t_1);
1818  __Pyx_XDECREF(__pyx_t_2);
1819  __Pyx_AddTraceback("freenect.CtxPtr.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1820  __pyx_r = NULL;
1821  __pyx_L0:;
1822  __Pyx_XGIVEREF(__pyx_r);
1823  __Pyx_RefNannyFinishContext();
1824  return __pyx_r;
1825 }
1826 
1827 /* "freenect.pyx":188
1828  * cdef freenect_device* _ptr
1829  * cdef CtxPtr ctx
1830  * def __init__(self): # <<<<<<<<<<<<<<
1831  * # Safety: do not allow Python to create instances as they would be NULL
1832  * raise TypeError("Cannot create instances of DevPtr from Python")
1833  */
1834 
1835 /* Python wrapper */
1836 static int __pyx_pw_8freenect_6DevPtr_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1837 static int __pyx_pw_8freenect_6DevPtr_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1838  int __pyx_r;
1839  __Pyx_RefNannyDeclarations
1840  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
1841  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
1842  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
1843  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
1844  __pyx_r = __pyx_pf_8freenect_6DevPtr___init__(((struct __pyx_obj_8freenect_DevPtr *)__pyx_v_self));
1845 
1846  /* function exit code */
1847  __Pyx_RefNannyFinishContext();
1848  return __pyx_r;
1849 }
1850 
1851 static int __pyx_pf_8freenect_6DevPtr___init__(CYTHON_UNUSED struct __pyx_obj_8freenect_DevPtr *__pyx_v_self) {
1852  int __pyx_r;
1853  __Pyx_RefNannyDeclarations
1854  PyObject *__pyx_t_1 = NULL;
1855  int __pyx_lineno = 0;
1856  const char *__pyx_filename = NULL;
1857  int __pyx_clineno = 0;
1858  __Pyx_RefNannySetupContext("__init__", 0);
1859 
1860  /* "freenect.pyx":190
1861  * def __init__(self):
1862  * # Safety: do not allow Python to create instances as they would be NULL
1863  * raise TypeError("Cannot create instances of DevPtr from Python") # <<<<<<<<<<<<<<
1864  *
1865  * def __repr__(self):
1866  */
1867  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1868  __Pyx_GOTREF(__pyx_t_1);
1869  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
1870  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1871  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1872 
1873  /* "freenect.pyx":188
1874  * cdef freenect_device* _ptr
1875  * cdef CtxPtr ctx
1876  * def __init__(self): # <<<<<<<<<<<<<<
1877  * # Safety: do not allow Python to create instances as they would be NULL
1878  * raise TypeError("Cannot create instances of DevPtr from Python")
1879  */
1880 
1881  /* function exit code */
1882  __pyx_L1_error:;
1883  __Pyx_XDECREF(__pyx_t_1);
1884  __Pyx_AddTraceback("freenect.DevPtr.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1885  __pyx_r = -1;
1886  __Pyx_RefNannyFinishContext();
1887  return __pyx_r;
1888 }
1889 
1890 /* "freenect.pyx":192
1891  * raise TypeError("Cannot create instances of DevPtr from Python")
1892  *
1893  * def __repr__(self): # <<<<<<<<<<<<<<
1894  * return "<Dev Pointer %s>" % _format_ptr(self._ptr)
1895  *
1896  */
1897 
1898 /* Python wrapper */
1899 static PyObject *__pyx_pw_8freenect_6DevPtr_3__repr__(PyObject *__pyx_v_self); /*proto*/
1900 static PyObject *__pyx_pw_8freenect_6DevPtr_3__repr__(PyObject *__pyx_v_self) {
1901  PyObject *__pyx_r = 0;
1902  __Pyx_RefNannyDeclarations
1903  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
1904  __pyx_r = __pyx_pf_8freenect_6DevPtr_2__repr__(((struct __pyx_obj_8freenect_DevPtr *)__pyx_v_self));
1905 
1906  /* function exit code */
1907  __Pyx_RefNannyFinishContext();
1908  return __pyx_r;
1909 }
1910 
1911 static PyObject *__pyx_pf_8freenect_6DevPtr_2__repr__(struct __pyx_obj_8freenect_DevPtr *__pyx_v_self) {
1912  PyObject *__pyx_r = NULL;
1913  __Pyx_RefNannyDeclarations
1914  PyObject *__pyx_t_1 = NULL;
1915  PyObject *__pyx_t_2 = NULL;
1916  int __pyx_lineno = 0;
1917  const char *__pyx_filename = NULL;
1918  int __pyx_clineno = 0;
1919  __Pyx_RefNannySetupContext("__repr__", 0);
1920 
1921  /* "freenect.pyx":193
1922  *
1923  * def __repr__(self):
1924  * return "<Dev Pointer %s>" % _format_ptr(self._ptr) # <<<<<<<<<<<<<<
1925  *
1926  * cdef class StatePtr:
1927  */
1928  __Pyx_XDECREF(__pyx_r);
1929  __pyx_t_1 = __pyx_f_8freenect__format_ptr(__pyx_v_self->_ptr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1930  __Pyx_GOTREF(__pyx_t_1);
1931  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Dev_Pointer_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1932  __Pyx_GOTREF(__pyx_t_2);
1933  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1934  __pyx_r = __pyx_t_2;
1935  __pyx_t_2 = 0;
1936  goto __pyx_L0;
1937 
1938  /* "freenect.pyx":192
1939  * raise TypeError("Cannot create instances of DevPtr from Python")
1940  *
1941  * def __repr__(self): # <<<<<<<<<<<<<<
1942  * return "<Dev Pointer %s>" % _format_ptr(self._ptr)
1943  *
1944  */
1945 
1946  /* function exit code */
1947  __pyx_L1_error:;
1948  __Pyx_XDECREF(__pyx_t_1);
1949  __Pyx_XDECREF(__pyx_t_2);
1950  __Pyx_AddTraceback("freenect.DevPtr.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1951  __pyx_r = NULL;
1952  __pyx_L0:;
1953  __Pyx_XGIVEREF(__pyx_r);
1954  __Pyx_RefNannyFinishContext();
1955  return __pyx_r;
1956 }
1957 
1958 /* "freenect.pyx":197
1959  * cdef class StatePtr:
1960  * cdef freenect_raw_tilt_state* _ptr
1961  * def __init__(self): # <<<<<<<<<<<<<<
1962  * # Safety: do not allow Python to create instances as they would be NULL
1963  * raise TypeError("Cannot create instances of StatePtr from Python")
1964  */
1965 
1966 /* Python wrapper */
1967 static int __pyx_pw_8freenect_8StatePtr_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1968 static int __pyx_pw_8freenect_8StatePtr_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1969  int __pyx_r;
1970  __Pyx_RefNannyDeclarations
1971  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
1972  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
1973  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
1974  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
1975  __pyx_r = __pyx_pf_8freenect_8StatePtr___init__(((struct __pyx_obj_8freenect_StatePtr *)__pyx_v_self));
1976 
1977  /* function exit code */
1978  __Pyx_RefNannyFinishContext();
1979  return __pyx_r;
1980 }
1981 
1982 static int __pyx_pf_8freenect_8StatePtr___init__(CYTHON_UNUSED struct __pyx_obj_8freenect_StatePtr *__pyx_v_self) {
1983  int __pyx_r;
1984  __Pyx_RefNannyDeclarations
1985  PyObject *__pyx_t_1 = NULL;
1986  int __pyx_lineno = 0;
1987  const char *__pyx_filename = NULL;
1988  int __pyx_clineno = 0;
1989  __Pyx_RefNannySetupContext("__init__", 0);
1990 
1991  /* "freenect.pyx":199
1992  * def __init__(self):
1993  * # Safety: do not allow Python to create instances as they would be NULL
1994  * raise TypeError("Cannot create instances of StatePtr from Python") # <<<<<<<<<<<<<<
1995  *
1996  * def __repr__(self):
1997  */
1998  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1999  __Pyx_GOTREF(__pyx_t_1);
2000  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2001  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2002  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2003 
2004  /* "freenect.pyx":197
2005  * cdef class StatePtr:
2006  * cdef freenect_raw_tilt_state* _ptr
2007  * def __init__(self): # <<<<<<<<<<<<<<
2008  * # Safety: do not allow Python to create instances as they would be NULL
2009  * raise TypeError("Cannot create instances of StatePtr from Python")
2010  */
2011 
2012  /* function exit code */
2013  __pyx_L1_error:;
2014  __Pyx_XDECREF(__pyx_t_1);
2015  __Pyx_AddTraceback("freenect.StatePtr.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2016  __pyx_r = -1;
2017  __Pyx_RefNannyFinishContext();
2018  return __pyx_r;
2019 }
2020 
2021 /* "freenect.pyx":201
2022  * raise TypeError("Cannot create instances of StatePtr from Python")
2023  *
2024  * def __repr__(self): # <<<<<<<<<<<<<<
2025  * return "<State Pointer %s>" % _format_ptr(self._ptr)
2026  *
2027  */
2028 
2029 /* Python wrapper */
2030 static PyObject *__pyx_pw_8freenect_8StatePtr_3__repr__(PyObject *__pyx_v_self); /*proto*/
2031 static PyObject *__pyx_pw_8freenect_8StatePtr_3__repr__(PyObject *__pyx_v_self) {
2032  PyObject *__pyx_r = 0;
2033  __Pyx_RefNannyDeclarations
2034  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
2035  __pyx_r = __pyx_pf_8freenect_8StatePtr_2__repr__(((struct __pyx_obj_8freenect_StatePtr *)__pyx_v_self));
2036 
2037  /* function exit code */
2038  __Pyx_RefNannyFinishContext();
2039  return __pyx_r;
2040 }
2041 
2042 static PyObject *__pyx_pf_8freenect_8StatePtr_2__repr__(struct __pyx_obj_8freenect_StatePtr *__pyx_v_self) {
2043  PyObject *__pyx_r = NULL;
2044  __Pyx_RefNannyDeclarations
2045  PyObject *__pyx_t_1 = NULL;
2046  PyObject *__pyx_t_2 = NULL;
2047  int __pyx_lineno = 0;
2048  const char *__pyx_filename = NULL;
2049  int __pyx_clineno = 0;
2050  __Pyx_RefNannySetupContext("__repr__", 0);
2051 
2052  /* "freenect.pyx":202
2053  *
2054  * def __repr__(self):
2055  * return "<State Pointer %s>" % _format_ptr(self._ptr) # <<<<<<<<<<<<<<
2056  *
2057  * def _get_accelx(self):
2058  */
2059  __Pyx_XDECREF(__pyx_r);
2060  __pyx_t_1 = __pyx_f_8freenect__format_ptr(__pyx_v_self->_ptr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2061  __Pyx_GOTREF(__pyx_t_1);
2062  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_State_Pointer_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2063  __Pyx_GOTREF(__pyx_t_2);
2064  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2065  __pyx_r = __pyx_t_2;
2066  __pyx_t_2 = 0;
2067  goto __pyx_L0;
2068 
2069  /* "freenect.pyx":201
2070  * raise TypeError("Cannot create instances of StatePtr from Python")
2071  *
2072  * def __repr__(self): # <<<<<<<<<<<<<<
2073  * return "<State Pointer %s>" % _format_ptr(self._ptr)
2074  *
2075  */
2076 
2077  /* function exit code */
2078  __pyx_L1_error:;
2079  __Pyx_XDECREF(__pyx_t_1);
2080  __Pyx_XDECREF(__pyx_t_2);
2081  __Pyx_AddTraceback("freenect.StatePtr.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2082  __pyx_r = NULL;
2083  __pyx_L0:;
2084  __Pyx_XGIVEREF(__pyx_r);
2085  __Pyx_RefNannyFinishContext();
2086  return __pyx_r;
2087 }
2088 
2089 /* "freenect.pyx":204
2090  * return "<State Pointer %s>" % _format_ptr(self._ptr)
2091  *
2092  * def _get_accelx(self): # <<<<<<<<<<<<<<
2093  * return int(self._ptr.accelerometer_x)
2094  *
2095  */
2096 
2097 /* Python wrapper */
2098 static PyObject *__pyx_pw_8freenect_8StatePtr_5_get_accelx(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2099 static PyObject *__pyx_pw_8freenect_8StatePtr_5_get_accelx(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2100  PyObject *__pyx_r = 0;
2101  __Pyx_RefNannyDeclarations
2102  __Pyx_RefNannySetupContext("_get_accelx (wrapper)", 0);
2103  __pyx_r = __pyx_pf_8freenect_8StatePtr_4_get_accelx(((struct __pyx_obj_8freenect_StatePtr *)__pyx_v_self));
2104 
2105  /* function exit code */
2106  __Pyx_RefNannyFinishContext();
2107  return __pyx_r;
2108 }
2109 
2110 static PyObject *__pyx_pf_8freenect_8StatePtr_4_get_accelx(struct __pyx_obj_8freenect_StatePtr *__pyx_v_self) {
2111  PyObject *__pyx_r = NULL;
2112  __Pyx_RefNannyDeclarations
2113  PyObject *__pyx_t_1 = NULL;
2114  PyObject *__pyx_t_2 = NULL;
2115  int __pyx_lineno = 0;
2116  const char *__pyx_filename = NULL;
2117  int __pyx_clineno = 0;
2118  __Pyx_RefNannySetupContext("_get_accelx", 0);
2119 
2120  /* "freenect.pyx":205
2121  *
2122  * def _get_accelx(self):
2123  * return int(self._ptr.accelerometer_x) # <<<<<<<<<<<<<<
2124  *
2125  * def _get_accely(self):
2126  */
2127  __Pyx_XDECREF(__pyx_r);
2128  __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_v_self->_ptr->accelerometer_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2129  __Pyx_GOTREF(__pyx_t_1);
2130  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2131  __Pyx_GOTREF(__pyx_t_2);
2132  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
2133  __Pyx_GIVEREF(__pyx_t_1);
2134  __pyx_t_1 = 0;
2135  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2136  __Pyx_GOTREF(__pyx_t_1);
2137  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2138  __pyx_r = __pyx_t_1;
2139  __pyx_t_1 = 0;
2140  goto __pyx_L0;
2141 
2142  /* "freenect.pyx":204
2143  * return "<State Pointer %s>" % _format_ptr(self._ptr)
2144  *
2145  * def _get_accelx(self): # <<<<<<<<<<<<<<
2146  * return int(self._ptr.accelerometer_x)
2147  *
2148  */
2149 
2150  /* function exit code */
2151  __pyx_L1_error:;
2152  __Pyx_XDECREF(__pyx_t_1);
2153  __Pyx_XDECREF(__pyx_t_2);
2154  __Pyx_AddTraceback("freenect.StatePtr._get_accelx", __pyx_clineno, __pyx_lineno, __pyx_filename);
2155  __pyx_r = NULL;
2156  __pyx_L0:;
2157  __Pyx_XGIVEREF(__pyx_r);
2158  __Pyx_RefNannyFinishContext();
2159  return __pyx_r;
2160 }
2161 
2162 /* "freenect.pyx":207
2163  * return int(self._ptr.accelerometer_x)
2164  *
2165  * def _get_accely(self): # <<<<<<<<<<<<<<
2166  * return int(self._ptr.accelerometer_y)
2167  *
2168  */
2169 
2170 /* Python wrapper */
2171 static PyObject *__pyx_pw_8freenect_8StatePtr_7_get_accely(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2172 static PyObject *__pyx_pw_8freenect_8StatePtr_7_get_accely(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2173  PyObject *__pyx_r = 0;
2174  __Pyx_RefNannyDeclarations
2175  __Pyx_RefNannySetupContext("_get_accely (wrapper)", 0);
2176  __pyx_r = __pyx_pf_8freenect_8StatePtr_6_get_accely(((struct __pyx_obj_8freenect_StatePtr *)__pyx_v_self));
2177 
2178  /* function exit code */
2179  __Pyx_RefNannyFinishContext();
2180  return __pyx_r;
2181 }
2182 
2183 static PyObject *__pyx_pf_8freenect_8StatePtr_6_get_accely(struct __pyx_obj_8freenect_StatePtr *__pyx_v_self) {
2184  PyObject *__pyx_r = NULL;
2185  __Pyx_RefNannyDeclarations
2186  PyObject *__pyx_t_1 = NULL;
2187  PyObject *__pyx_t_2 = NULL;
2188  int __pyx_lineno = 0;
2189  const char *__pyx_filename = NULL;
2190  int __pyx_clineno = 0;
2191  __Pyx_RefNannySetupContext("_get_accely", 0);
2192 
2193  /* "freenect.pyx":208
2194  *
2195  * def _get_accely(self):
2196  * return int(self._ptr.accelerometer_y) # <<<<<<<<<<<<<<
2197  *
2198  * def _get_accelz(self):
2199  */
2200  __Pyx_XDECREF(__pyx_r);
2201  __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_v_self->_ptr->accelerometer_y); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2202  __Pyx_GOTREF(__pyx_t_1);
2203  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2204  __Pyx_GOTREF(__pyx_t_2);
2205  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
2206  __Pyx_GIVEREF(__pyx_t_1);
2207  __pyx_t_1 = 0;
2208  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2209  __Pyx_GOTREF(__pyx_t_1);
2210  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2211  __pyx_r = __pyx_t_1;
2212  __pyx_t_1 = 0;
2213  goto __pyx_L0;
2214 
2215  /* "freenect.pyx":207
2216  * return int(self._ptr.accelerometer_x)
2217  *
2218  * def _get_accely(self): # <<<<<<<<<<<<<<
2219  * return int(self._ptr.accelerometer_y)
2220  *
2221  */
2222 
2223  /* function exit code */
2224  __pyx_L1_error:;
2225  __Pyx_XDECREF(__pyx_t_1);
2226  __Pyx_XDECREF(__pyx_t_2);
2227  __Pyx_AddTraceback("freenect.StatePtr._get_accely", __pyx_clineno, __pyx_lineno, __pyx_filename);
2228  __pyx_r = NULL;
2229  __pyx_L0:;
2230  __Pyx_XGIVEREF(__pyx_r);
2231  __Pyx_RefNannyFinishContext();
2232  return __pyx_r;
2233 }
2234 
2235 /* "freenect.pyx":210
2236  * return int(self._ptr.accelerometer_y)
2237  *
2238  * def _get_accelz(self): # <<<<<<<<<<<<<<
2239  * return int(self._ptr.accelerometer_z)
2240  *
2241  */
2242 
2243 /* Python wrapper */
2244 static PyObject *__pyx_pw_8freenect_8StatePtr_9_get_accelz(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2245 static PyObject *__pyx_pw_8freenect_8StatePtr_9_get_accelz(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2246  PyObject *__pyx_r = 0;
2247  __Pyx_RefNannyDeclarations
2248  __Pyx_RefNannySetupContext("_get_accelz (wrapper)", 0);
2249  __pyx_r = __pyx_pf_8freenect_8StatePtr_8_get_accelz(((struct __pyx_obj_8freenect_StatePtr *)__pyx_v_self));
2250 
2251  /* function exit code */
2252  __Pyx_RefNannyFinishContext();
2253  return __pyx_r;
2254 }
2255 
2256 static PyObject *__pyx_pf_8freenect_8StatePtr_8_get_accelz(struct __pyx_obj_8freenect_StatePtr *__pyx_v_self) {
2257  PyObject *__pyx_r = NULL;
2258  __Pyx_RefNannyDeclarations
2259  PyObject *__pyx_t_1 = NULL;
2260  PyObject *__pyx_t_2 = NULL;
2261  int __pyx_lineno = 0;
2262  const char *__pyx_filename = NULL;
2263  int __pyx_clineno = 0;
2264  __Pyx_RefNannySetupContext("_get_accelz", 0);
2265 
2266  /* "freenect.pyx":211
2267  *
2268  * def _get_accelz(self):
2269  * return int(self._ptr.accelerometer_z) # <<<<<<<<<<<<<<
2270  *
2271  * def _get_tilt_angle(self):
2272  */
2273  __Pyx_XDECREF(__pyx_r);
2274  __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_v_self->_ptr->accelerometer_z); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2275  __Pyx_GOTREF(__pyx_t_1);
2276  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2277  __Pyx_GOTREF(__pyx_t_2);
2278  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
2279  __Pyx_GIVEREF(__pyx_t_1);
2280  __pyx_t_1 = 0;
2281  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2282  __Pyx_GOTREF(__pyx_t_1);
2283  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2284  __pyx_r = __pyx_t_1;
2285  __pyx_t_1 = 0;
2286  goto __pyx_L0;
2287 
2288  /* "freenect.pyx":210
2289  * return int(self._ptr.accelerometer_y)
2290  *
2291  * def _get_accelz(self): # <<<<<<<<<<<<<<
2292  * return int(self._ptr.accelerometer_z)
2293  *
2294  */
2295 
2296  /* function exit code */
2297  __pyx_L1_error:;
2298  __Pyx_XDECREF(__pyx_t_1);
2299  __Pyx_XDECREF(__pyx_t_2);
2300  __Pyx_AddTraceback("freenect.StatePtr._get_accelz", __pyx_clineno, __pyx_lineno, __pyx_filename);
2301  __pyx_r = NULL;
2302  __pyx_L0:;
2303  __Pyx_XGIVEREF(__pyx_r);
2304  __Pyx_RefNannyFinishContext();
2305  return __pyx_r;
2306 }
2307 
2308 /* "freenect.pyx":213
2309  * return int(self._ptr.accelerometer_z)
2310  *
2311  * def _get_tilt_angle(self): # <<<<<<<<<<<<<<
2312  * return int(self._ptr.tilt_angle)
2313  *
2314  */
2315 
2316 /* Python wrapper */
2317 static PyObject *__pyx_pw_8freenect_8StatePtr_11_get_tilt_angle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2318 static PyObject *__pyx_pw_8freenect_8StatePtr_11_get_tilt_angle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2319  PyObject *__pyx_r = 0;
2320  __Pyx_RefNannyDeclarations
2321  __Pyx_RefNannySetupContext("_get_tilt_angle (wrapper)", 0);
2322  __pyx_r = __pyx_pf_8freenect_8StatePtr_10_get_tilt_angle(((struct __pyx_obj_8freenect_StatePtr *)__pyx_v_self));
2323 
2324  /* function exit code */
2325  __Pyx_RefNannyFinishContext();
2326  return __pyx_r;
2327 }
2328 
2329 static PyObject *__pyx_pf_8freenect_8StatePtr_10_get_tilt_angle(struct __pyx_obj_8freenect_StatePtr *__pyx_v_self) {
2330  PyObject *__pyx_r = NULL;
2331  __Pyx_RefNannyDeclarations
2332  PyObject *__pyx_t_1 = NULL;
2333  PyObject *__pyx_t_2 = NULL;
2334  int __pyx_lineno = 0;
2335  const char *__pyx_filename = NULL;
2336  int __pyx_clineno = 0;
2337  __Pyx_RefNannySetupContext("_get_tilt_angle", 0);
2338 
2339  /* "freenect.pyx":214
2340  *
2341  * def _get_tilt_angle(self):
2342  * return int(self._ptr.tilt_angle) # <<<<<<<<<<<<<<
2343  *
2344  * def _get_tilt_status(self):
2345  */
2346  __Pyx_XDECREF(__pyx_r);
2347  __pyx_t_1 = __Pyx_PyInt_From_int8_t(__pyx_v_self->_ptr->tilt_angle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2348  __Pyx_GOTREF(__pyx_t_1);
2349  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2350  __Pyx_GOTREF(__pyx_t_2);
2351  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
2352  __Pyx_GIVEREF(__pyx_t_1);
2353  __pyx_t_1 = 0;
2354  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2355  __Pyx_GOTREF(__pyx_t_1);
2356  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2357  __pyx_r = __pyx_t_1;
2358  __pyx_t_1 = 0;
2359  goto __pyx_L0;
2360 
2361  /* "freenect.pyx":213
2362  * return int(self._ptr.accelerometer_z)
2363  *
2364  * def _get_tilt_angle(self): # <<<<<<<<<<<<<<
2365  * return int(self._ptr.tilt_angle)
2366  *
2367  */
2368 
2369  /* function exit code */
2370  __pyx_L1_error:;
2371  __Pyx_XDECREF(__pyx_t_1);
2372  __Pyx_XDECREF(__pyx_t_2);
2373  __Pyx_AddTraceback("freenect.StatePtr._get_tilt_angle", __pyx_clineno, __pyx_lineno, __pyx_filename);
2374  __pyx_r = NULL;
2375  __pyx_L0:;
2376  __Pyx_XGIVEREF(__pyx_r);
2377  __Pyx_RefNannyFinishContext();
2378  return __pyx_r;
2379 }
2380 
2381 /* "freenect.pyx":216
2382  * return int(self._ptr.tilt_angle)
2383  *
2384  * def _get_tilt_status(self): # <<<<<<<<<<<<<<
2385  * return int(self._ptr.tilt_status)
2386  *
2387  */
2388 
2389 /* Python wrapper */
2390 static PyObject *__pyx_pw_8freenect_8StatePtr_13_get_tilt_status(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2391 static PyObject *__pyx_pw_8freenect_8StatePtr_13_get_tilt_status(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2392  PyObject *__pyx_r = 0;
2393  __Pyx_RefNannyDeclarations
2394  __Pyx_RefNannySetupContext("_get_tilt_status (wrapper)", 0);
2395  __pyx_r = __pyx_pf_8freenect_8StatePtr_12_get_tilt_status(((struct __pyx_obj_8freenect_StatePtr *)__pyx_v_self));
2396 
2397  /* function exit code */
2398  __Pyx_RefNannyFinishContext();
2399  return __pyx_r;
2400 }
2401 
2402 static PyObject *__pyx_pf_8freenect_8StatePtr_12_get_tilt_status(struct __pyx_obj_8freenect_StatePtr *__pyx_v_self) {
2403  PyObject *__pyx_r = NULL;
2404  __Pyx_RefNannyDeclarations
2405  PyObject *__pyx_t_1 = NULL;
2406  PyObject *__pyx_t_2 = NULL;
2407  int __pyx_lineno = 0;
2408  const char *__pyx_filename = NULL;
2409  int __pyx_clineno = 0;
2410  __Pyx_RefNannySetupContext("_get_tilt_status", 0);
2411 
2412  /* "freenect.pyx":217
2413  *
2414  * def _get_tilt_status(self):
2415  * return int(self._ptr.tilt_status) # <<<<<<<<<<<<<<
2416  *
2417  * accelerometer_x = property(_get_accelx)
2418  */
2419  __Pyx_XDECREF(__pyx_r);
2420  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_ptr->tilt_status); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2421  __Pyx_GOTREF(__pyx_t_1);
2422  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2423  __Pyx_GOTREF(__pyx_t_2);
2424  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
2425  __Pyx_GIVEREF(__pyx_t_1);
2426  __pyx_t_1 = 0;
2427  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2428  __Pyx_GOTREF(__pyx_t_1);
2429  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2430  __pyx_r = __pyx_t_1;
2431  __pyx_t_1 = 0;
2432  goto __pyx_L0;
2433 
2434  /* "freenect.pyx":216
2435  * return int(self._ptr.tilt_angle)
2436  *
2437  * def _get_tilt_status(self): # <<<<<<<<<<<<<<
2438  * return int(self._ptr.tilt_status)
2439  *
2440  */
2441 
2442  /* function exit code */
2443  __pyx_L1_error:;
2444  __Pyx_XDECREF(__pyx_t_1);
2445  __Pyx_XDECREF(__pyx_t_2);
2446  __Pyx_AddTraceback("freenect.StatePtr._get_tilt_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
2447  __pyx_r = NULL;
2448  __pyx_L0:;
2449  __Pyx_XGIVEREF(__pyx_r);
2450  __Pyx_RefNannyFinishContext();
2451  return __pyx_r;
2452 }
2453 
2454 /* "freenect.pyx":225
2455  * tilt_status = property(_get_tilt_status)
2456  *
2457  * def set_depth_mode(DevPtr dev, int res, int mode): # <<<<<<<<<<<<<<
2458  * return freenect_set_depth_mode(dev._ptr, freenect_find_depth_mode(res, mode))
2459  *
2460  */
2461 
2462 /* Python wrapper */
2463 static PyObject *__pyx_pw_8freenect_1set_depth_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2464 static PyMethodDef __pyx_mdef_8freenect_1set_depth_mode = {__Pyx_NAMESTR("set_depth_mode"), (PyCFunction)__pyx_pw_8freenect_1set_depth_mode, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
2465 static PyObject *__pyx_pw_8freenect_1set_depth_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2466  struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev = 0;
2467  int __pyx_v_res;
2468  int __pyx_v_mode;
2469  int __pyx_lineno = 0;
2470  const char *__pyx_filename = NULL;
2471  int __pyx_clineno = 0;
2472  PyObject *__pyx_r = 0;
2473  __Pyx_RefNannyDeclarations
2474  __Pyx_RefNannySetupContext("set_depth_mode (wrapper)", 0);
2475  {
2476  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dev,&__pyx_n_s_res,&__pyx_n_s_mode,0};
2477  PyObject* values[3] = {0,0,0};
2478  if (unlikely(__pyx_kwds)) {
2479  Py_ssize_t kw_args;
2480  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2481  switch (pos_args) {
2482  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2483  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2484  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2485  case 0: break;
2486  default: goto __pyx_L5_argtuple_error;
2487  }
2488  kw_args = PyDict_Size(__pyx_kwds);
2489  switch (pos_args) {
2490  case 0:
2491  if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev)) != 0)) kw_args--;
2492  else goto __pyx_L5_argtuple_error;
2493  case 1:
2494  if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_res)) != 0)) kw_args--;
2495  else {
2496  __Pyx_RaiseArgtupleInvalid("set_depth_mode", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2497  }
2498  case 2:
2499  if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
2500  else {
2501  __Pyx_RaiseArgtupleInvalid("set_depth_mode", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2502  }
2503  }
2504  if (unlikely(kw_args > 0)) {
2505  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_depth_mode") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2506  }
2507  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2508  goto __pyx_L5_argtuple_error;
2509  } else {
2510  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2511  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2512  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2513  }
2514  __pyx_v_dev = ((struct __pyx_obj_8freenect_DevPtr *)values[0]);
2515  __pyx_v_res = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_res == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2516  __pyx_v_mode = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2517  }
2518  goto __pyx_L4_argument_unpacking_done;
2519  __pyx_L5_argtuple_error:;
2520  __Pyx_RaiseArgtupleInvalid("set_depth_mode", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2521  __pyx_L3_error:;
2522  __Pyx_AddTraceback("freenect.set_depth_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
2523  __Pyx_RefNannyFinishContext();
2524  return NULL;
2525  __pyx_L4_argument_unpacking_done:;
2526  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2527  __pyx_r = __pyx_pf_8freenect_set_depth_mode(__pyx_self, __pyx_v_dev, __pyx_v_res, __pyx_v_mode);
2528 
2529  /* function exit code */
2530  goto __pyx_L0;
2531  __pyx_L1_error:;
2532  __pyx_r = NULL;
2533  __pyx_L0:;
2534  __Pyx_RefNannyFinishContext();
2535  return __pyx_r;
2536 }
2537 
2538 static PyObject *__pyx_pf_8freenect_set_depth_mode(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev, int __pyx_v_res, int __pyx_v_mode) {
2539  PyObject *__pyx_r = NULL;
2540  __Pyx_RefNannyDeclarations
2541  PyObject *__pyx_t_1 = NULL;
2542  int __pyx_lineno = 0;
2543  const char *__pyx_filename = NULL;
2544  int __pyx_clineno = 0;
2545  __Pyx_RefNannySetupContext("set_depth_mode", 0);
2546 
2547  /* "freenect.pyx":226
2548  *
2549  * def set_depth_mode(DevPtr dev, int res, int mode):
2550  * return freenect_set_depth_mode(dev._ptr, freenect_find_depth_mode(res, mode)) # <<<<<<<<<<<<<<
2551  *
2552  * def set_video_mode(DevPtr dev, int res, int mode):
2553  */
2554  __Pyx_XDECREF(__pyx_r);
2555  __pyx_t_1 = __Pyx_PyInt_From_int(freenect_set_depth_mode(__pyx_v_dev->_ptr, freenect_find_depth_mode(__pyx_v_res, __pyx_v_mode))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2556  __Pyx_GOTREF(__pyx_t_1);
2557  __pyx_r = __pyx_t_1;
2558  __pyx_t_1 = 0;
2559  goto __pyx_L0;
2560 
2561  /* "freenect.pyx":225
2562  * tilt_status = property(_get_tilt_status)
2563  *
2564  * def set_depth_mode(DevPtr dev, int res, int mode): # <<<<<<<<<<<<<<
2565  * return freenect_set_depth_mode(dev._ptr, freenect_find_depth_mode(res, mode))
2566  *
2567  */
2568 
2569  /* function exit code */
2570  __pyx_L1_error:;
2571  __Pyx_XDECREF(__pyx_t_1);
2572  __Pyx_AddTraceback("freenect.set_depth_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
2573  __pyx_r = NULL;
2574  __pyx_L0:;
2575  __Pyx_XGIVEREF(__pyx_r);
2576  __Pyx_RefNannyFinishContext();
2577  return __pyx_r;
2578 }
2579 
2580 /* "freenect.pyx":228
2581  * return freenect_set_depth_mode(dev._ptr, freenect_find_depth_mode(res, mode))
2582  *
2583  * def set_video_mode(DevPtr dev, int res, int mode): # <<<<<<<<<<<<<<
2584  * return freenect_set_video_mode(dev._ptr, freenect_find_video_mode(res, mode))
2585  *
2586  */
2587 
2588 /* Python wrapper */
2589 static PyObject *__pyx_pw_8freenect_3set_video_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2590 static PyMethodDef __pyx_mdef_8freenect_3set_video_mode = {__Pyx_NAMESTR("set_video_mode"), (PyCFunction)__pyx_pw_8freenect_3set_video_mode, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
2591 static PyObject *__pyx_pw_8freenect_3set_video_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2592  struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev = 0;
2593  int __pyx_v_res;
2594  int __pyx_v_mode;
2595  int __pyx_lineno = 0;
2596  const char *__pyx_filename = NULL;
2597  int __pyx_clineno = 0;
2598  PyObject *__pyx_r = 0;
2599  __Pyx_RefNannyDeclarations
2600  __Pyx_RefNannySetupContext("set_video_mode (wrapper)", 0);
2601  {
2602  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dev,&__pyx_n_s_res,&__pyx_n_s_mode,0};
2603  PyObject* values[3] = {0,0,0};
2604  if (unlikely(__pyx_kwds)) {
2605  Py_ssize_t kw_args;
2606  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2607  switch (pos_args) {
2608  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2609  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2610  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2611  case 0: break;
2612  default: goto __pyx_L5_argtuple_error;
2613  }
2614  kw_args = PyDict_Size(__pyx_kwds);
2615  switch (pos_args) {
2616  case 0:
2617  if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev)) != 0)) kw_args--;
2618  else goto __pyx_L5_argtuple_error;
2619  case 1:
2620  if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_res)) != 0)) kw_args--;
2621  else {
2622  __Pyx_RaiseArgtupleInvalid("set_video_mode", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2623  }
2624  case 2:
2625  if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
2626  else {
2627  __Pyx_RaiseArgtupleInvalid("set_video_mode", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2628  }
2629  }
2630  if (unlikely(kw_args > 0)) {
2631  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_video_mode") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2632  }
2633  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2634  goto __pyx_L5_argtuple_error;
2635  } else {
2636  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2637  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2638  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2639  }
2640  __pyx_v_dev = ((struct __pyx_obj_8freenect_DevPtr *)values[0]);
2641  __pyx_v_res = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_res == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2642  __pyx_v_mode = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2643  }
2644  goto __pyx_L4_argument_unpacking_done;
2645  __pyx_L5_argtuple_error:;
2646  __Pyx_RaiseArgtupleInvalid("set_video_mode", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2647  __pyx_L3_error:;
2648  __Pyx_AddTraceback("freenect.set_video_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
2649  __Pyx_RefNannyFinishContext();
2650  return NULL;
2651  __pyx_L4_argument_unpacking_done:;
2652  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2653  __pyx_r = __pyx_pf_8freenect_2set_video_mode(__pyx_self, __pyx_v_dev, __pyx_v_res, __pyx_v_mode);
2654 
2655  /* function exit code */
2656  goto __pyx_L0;
2657  __pyx_L1_error:;
2658  __pyx_r = NULL;
2659  __pyx_L0:;
2660  __Pyx_RefNannyFinishContext();
2661  return __pyx_r;
2662 }
2663 
2664 static PyObject *__pyx_pf_8freenect_2set_video_mode(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev, int __pyx_v_res, int __pyx_v_mode) {
2665  PyObject *__pyx_r = NULL;
2666  __Pyx_RefNannyDeclarations
2667  PyObject *__pyx_t_1 = NULL;
2668  int __pyx_lineno = 0;
2669  const char *__pyx_filename = NULL;
2670  int __pyx_clineno = 0;
2671  __Pyx_RefNannySetupContext("set_video_mode", 0);
2672 
2673  /* "freenect.pyx":229
2674  *
2675  * def set_video_mode(DevPtr dev, int res, int mode):
2676  * return freenect_set_video_mode(dev._ptr, freenect_find_video_mode(res, mode)) # <<<<<<<<<<<<<<
2677  *
2678  * def get_depth_format(DevPtr dev):
2679  */
2680  __Pyx_XDECREF(__pyx_r);
2681  __pyx_t_1 = __Pyx_PyInt_From_int(freenect_set_video_mode(__pyx_v_dev->_ptr, freenect_find_video_mode(__pyx_v_res, __pyx_v_mode))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2682  __Pyx_GOTREF(__pyx_t_1);
2683  __pyx_r = __pyx_t_1;
2684  __pyx_t_1 = 0;
2685  goto __pyx_L0;
2686 
2687  /* "freenect.pyx":228
2688  * return freenect_set_depth_mode(dev._ptr, freenect_find_depth_mode(res, mode))
2689  *
2690  * def set_video_mode(DevPtr dev, int res, int mode): # <<<<<<<<<<<<<<
2691  * return freenect_set_video_mode(dev._ptr, freenect_find_video_mode(res, mode))
2692  *
2693  */
2694 
2695  /* function exit code */
2696  __pyx_L1_error:;
2697  __Pyx_XDECREF(__pyx_t_1);
2698  __Pyx_AddTraceback("freenect.set_video_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
2699  __pyx_r = NULL;
2700  __pyx_L0:;
2701  __Pyx_XGIVEREF(__pyx_r);
2702  __Pyx_RefNannyFinishContext();
2703  return __pyx_r;
2704 }
2705 
2706 /* "freenect.pyx":231
2707  * return freenect_set_video_mode(dev._ptr, freenect_find_video_mode(res, mode))
2708  *
2709  * def get_depth_format(DevPtr dev): # <<<<<<<<<<<<<<
2710  * return freenect_get_current_depth_mode(dev._ptr).video_format
2711  *
2712  */
2713 
2714 /* Python wrapper */
2715 static PyObject *__pyx_pw_8freenect_5get_depth_format(PyObject *__pyx_self, PyObject *__pyx_v_dev); /*proto*/
2716 static PyMethodDef __pyx_mdef_8freenect_5get_depth_format = {__Pyx_NAMESTR("get_depth_format"), (PyCFunction)__pyx_pw_8freenect_5get_depth_format, METH_O, __Pyx_DOCSTR(0)};
2717 static PyObject *__pyx_pw_8freenect_5get_depth_format(PyObject *__pyx_self, PyObject *__pyx_v_dev) {
2718  CYTHON_UNUSED int __pyx_lineno = 0;
2719  CYTHON_UNUSED const char *__pyx_filename = NULL;
2720  CYTHON_UNUSED int __pyx_clineno = 0;
2721  PyObject *__pyx_r = 0;
2722  __Pyx_RefNannyDeclarations
2723  __Pyx_RefNannySetupContext("get_depth_format (wrapper)", 0);
2724  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2725  __pyx_r = __pyx_pf_8freenect_4get_depth_format(__pyx_self, ((struct __pyx_obj_8freenect_DevPtr *)__pyx_v_dev));
2726 
2727  /* function exit code */
2728  goto __pyx_L0;
2729  __pyx_L1_error:;
2730  __pyx_r = NULL;
2731  __pyx_L0:;
2732  __Pyx_RefNannyFinishContext();
2733  return __pyx_r;
2734 }
2735 
2736 static PyObject *__pyx_pf_8freenect_4get_depth_format(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev) {
2737  PyObject *__pyx_r = NULL;
2738  __Pyx_RefNannyDeclarations
2739  PyObject *__pyx_t_1 = NULL;
2740  int __pyx_lineno = 0;
2741  const char *__pyx_filename = NULL;
2742  int __pyx_clineno = 0;
2743  __Pyx_RefNannySetupContext("get_depth_format", 0);
2744 
2745  /* "freenect.pyx":232
2746  *
2747  * def get_depth_format(DevPtr dev):
2748  * return freenect_get_current_depth_mode(dev._ptr).video_format # <<<<<<<<<<<<<<
2749  *
2750  * def get_video_format(DevPtr dev):
2751  */
2752  __Pyx_XDECREF(__pyx_r);
2753  __pyx_t_1 = __Pyx_PyInt_From_int32_t(freenect_get_current_depth_mode(__pyx_v_dev->_ptr).video_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2754  __Pyx_GOTREF(__pyx_t_1);
2755  __pyx_r = __pyx_t_1;
2756  __pyx_t_1 = 0;
2757  goto __pyx_L0;
2758 
2759  /* "freenect.pyx":231
2760  * return freenect_set_video_mode(dev._ptr, freenect_find_video_mode(res, mode))
2761  *
2762  * def get_depth_format(DevPtr dev): # <<<<<<<<<<<<<<
2763  * return freenect_get_current_depth_mode(dev._ptr).video_format
2764  *
2765  */
2766 
2767  /* function exit code */
2768  __pyx_L1_error:;
2769  __Pyx_XDECREF(__pyx_t_1);
2770  __Pyx_AddTraceback("freenect.get_depth_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
2771  __pyx_r = NULL;
2772  __pyx_L0:;
2773  __Pyx_XGIVEREF(__pyx_r);
2774  __Pyx_RefNannyFinishContext();
2775  return __pyx_r;
2776 }
2777 
2778 /* "freenect.pyx":234
2779  * return freenect_get_current_depth_mode(dev._ptr).video_format
2780  *
2781  * def get_video_format(DevPtr dev): # <<<<<<<<<<<<<<
2782  * return freenect_get_current_video_mode(dev._ptr).video_format
2783  *
2784  */
2785 
2786 /* Python wrapper */
2787 static PyObject *__pyx_pw_8freenect_7get_video_format(PyObject *__pyx_self, PyObject *__pyx_v_dev); /*proto*/
2788 static PyMethodDef __pyx_mdef_8freenect_7get_video_format = {__Pyx_NAMESTR("get_video_format"), (PyCFunction)__pyx_pw_8freenect_7get_video_format, METH_O, __Pyx_DOCSTR(0)};
2789 static PyObject *__pyx_pw_8freenect_7get_video_format(PyObject *__pyx_self, PyObject *__pyx_v_dev) {
2790  CYTHON_UNUSED int __pyx_lineno = 0;
2791  CYTHON_UNUSED const char *__pyx_filename = NULL;
2792  CYTHON_UNUSED int __pyx_clineno = 0;
2793  PyObject *__pyx_r = 0;
2794  __Pyx_RefNannyDeclarations
2795  __Pyx_RefNannySetupContext("get_video_format (wrapper)", 0);
2796  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2797  __pyx_r = __pyx_pf_8freenect_6get_video_format(__pyx_self, ((struct __pyx_obj_8freenect_DevPtr *)__pyx_v_dev));
2798 
2799  /* function exit code */
2800  goto __pyx_L0;
2801  __pyx_L1_error:;
2802  __pyx_r = NULL;
2803  __pyx_L0:;
2804  __Pyx_RefNannyFinishContext();
2805  return __pyx_r;
2806 }
2807 
2808 static PyObject *__pyx_pf_8freenect_6get_video_format(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev) {
2809  PyObject *__pyx_r = NULL;
2810  __Pyx_RefNannyDeclarations
2811  PyObject *__pyx_t_1 = NULL;
2812  int __pyx_lineno = 0;
2813  const char *__pyx_filename = NULL;
2814  int __pyx_clineno = 0;
2815  __Pyx_RefNannySetupContext("get_video_format", 0);
2816 
2817  /* "freenect.pyx":235
2818  *
2819  * def get_video_format(DevPtr dev):
2820  * return freenect_get_current_video_mode(dev._ptr).video_format # <<<<<<<<<<<<<<
2821  *
2822  * def start_depth(DevPtr dev):
2823  */
2824  __Pyx_XDECREF(__pyx_r);
2825  __pyx_t_1 = __Pyx_PyInt_From_int32_t(freenect_get_current_video_mode(__pyx_v_dev->_ptr).video_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2826  __Pyx_GOTREF(__pyx_t_1);
2827  __pyx_r = __pyx_t_1;
2828  __pyx_t_1 = 0;
2829  goto __pyx_L0;
2830 
2831  /* "freenect.pyx":234
2832  * return freenect_get_current_depth_mode(dev._ptr).video_format
2833  *
2834  * def get_video_format(DevPtr dev): # <<<<<<<<<<<<<<
2835  * return freenect_get_current_video_mode(dev._ptr).video_format
2836  *
2837  */
2838 
2839  /* function exit code */
2840  __pyx_L1_error:;
2841  __Pyx_XDECREF(__pyx_t_1);
2842  __Pyx_AddTraceback("freenect.get_video_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
2843  __pyx_r = NULL;
2844  __pyx_L0:;
2845  __Pyx_XGIVEREF(__pyx_r);
2846  __Pyx_RefNannyFinishContext();
2847  return __pyx_r;
2848 }
2849 
2850 /* "freenect.pyx":237
2851  * return freenect_get_current_video_mode(dev._ptr).video_format
2852  *
2853  * def start_depth(DevPtr dev): # <<<<<<<<<<<<<<
2854  * return freenect_start_depth(dev._ptr)
2855  *
2856  */
2857 
2858 /* Python wrapper */
2859 static PyObject *__pyx_pw_8freenect_9start_depth(PyObject *__pyx_self, PyObject *__pyx_v_dev); /*proto*/
2860 static PyMethodDef __pyx_mdef_8freenect_9start_depth = {__Pyx_NAMESTR("start_depth"), (PyCFunction)__pyx_pw_8freenect_9start_depth, METH_O, __Pyx_DOCSTR(0)};
2861 static PyObject *__pyx_pw_8freenect_9start_depth(PyObject *__pyx_self, PyObject *__pyx_v_dev) {
2862  CYTHON_UNUSED int __pyx_lineno = 0;
2863  CYTHON_UNUSED const char *__pyx_filename = NULL;
2864  CYTHON_UNUSED int __pyx_clineno = 0;
2865  PyObject *__pyx_r = 0;
2866  __Pyx_RefNannyDeclarations
2867  __Pyx_RefNannySetupContext("start_depth (wrapper)", 0);
2868  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2869  __pyx_r = __pyx_pf_8freenect_8start_depth(__pyx_self, ((struct __pyx_obj_8freenect_DevPtr *)__pyx_v_dev));
2870 
2871  /* function exit code */
2872  goto __pyx_L0;
2873  __pyx_L1_error:;
2874  __pyx_r = NULL;
2875  __pyx_L0:;
2876  __Pyx_RefNannyFinishContext();
2877  return __pyx_r;
2878 }
2879 
2880 static PyObject *__pyx_pf_8freenect_8start_depth(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev) {
2881  PyObject *__pyx_r = NULL;
2882  __Pyx_RefNannyDeclarations
2883  PyObject *__pyx_t_1 = NULL;
2884  int __pyx_lineno = 0;
2885  const char *__pyx_filename = NULL;
2886  int __pyx_clineno = 0;
2887  __Pyx_RefNannySetupContext("start_depth", 0);
2888 
2889  /* "freenect.pyx":238
2890  *
2891  * def start_depth(DevPtr dev):
2892  * return freenect_start_depth(dev._ptr) # <<<<<<<<<<<<<<
2893  *
2894  * def start_video(DevPtr dev):
2895  */
2896  __Pyx_XDECREF(__pyx_r);
2897  __pyx_t_1 = __Pyx_PyInt_From_int(freenect_start_depth(__pyx_v_dev->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2898  __Pyx_GOTREF(__pyx_t_1);
2899  __pyx_r = __pyx_t_1;
2900  __pyx_t_1 = 0;
2901  goto __pyx_L0;
2902 
2903  /* "freenect.pyx":237
2904  * return freenect_get_current_video_mode(dev._ptr).video_format
2905  *
2906  * def start_depth(DevPtr dev): # <<<<<<<<<<<<<<
2907  * return freenect_start_depth(dev._ptr)
2908  *
2909  */
2910 
2911  /* function exit code */
2912  __pyx_L1_error:;
2913  __Pyx_XDECREF(__pyx_t_1);
2914  __Pyx_AddTraceback("freenect.start_depth", __pyx_clineno, __pyx_lineno, __pyx_filename);
2915  __pyx_r = NULL;
2916  __pyx_L0:;
2917  __Pyx_XGIVEREF(__pyx_r);
2918  __Pyx_RefNannyFinishContext();
2919  return __pyx_r;
2920 }
2921 
2922 /* "freenect.pyx":240
2923  * return freenect_start_depth(dev._ptr)
2924  *
2925  * def start_video(DevPtr dev): # <<<<<<<<<<<<<<
2926  * return freenect_start_video(dev._ptr)
2927  *
2928  */
2929 
2930 /* Python wrapper */
2931 static PyObject *__pyx_pw_8freenect_11start_video(PyObject *__pyx_self, PyObject *__pyx_v_dev); /*proto*/
2932 static PyMethodDef __pyx_mdef_8freenect_11start_video = {__Pyx_NAMESTR("start_video"), (PyCFunction)__pyx_pw_8freenect_11start_video, METH_O, __Pyx_DOCSTR(0)};
2933 static PyObject *__pyx_pw_8freenect_11start_video(PyObject *__pyx_self, PyObject *__pyx_v_dev) {
2934  CYTHON_UNUSED int __pyx_lineno = 0;
2935  CYTHON_UNUSED const char *__pyx_filename = NULL;
2936  CYTHON_UNUSED int __pyx_clineno = 0;
2937  PyObject *__pyx_r = 0;
2938  __Pyx_RefNannyDeclarations
2939  __Pyx_RefNannySetupContext("start_video (wrapper)", 0);
2940  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2941  __pyx_r = __pyx_pf_8freenect_10start_video(__pyx_self, ((struct __pyx_obj_8freenect_DevPtr *)__pyx_v_dev));
2942 
2943  /* function exit code */
2944  goto __pyx_L0;
2945  __pyx_L1_error:;
2946  __pyx_r = NULL;
2947  __pyx_L0:;
2948  __Pyx_RefNannyFinishContext();
2949  return __pyx_r;
2950 }
2951 
2952 static PyObject *__pyx_pf_8freenect_10start_video(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev) {
2953  PyObject *__pyx_r = NULL;
2954  __Pyx_RefNannyDeclarations
2955  PyObject *__pyx_t_1 = NULL;
2956  int __pyx_lineno = 0;
2957  const char *__pyx_filename = NULL;
2958  int __pyx_clineno = 0;
2959  __Pyx_RefNannySetupContext("start_video", 0);
2960 
2961  /* "freenect.pyx":241
2962  *
2963  * def start_video(DevPtr dev):
2964  * return freenect_start_video(dev._ptr) # <<<<<<<<<<<<<<
2965  *
2966  * def stop_depth(DevPtr dev):
2967  */
2968  __Pyx_XDECREF(__pyx_r);
2969  __pyx_t_1 = __Pyx_PyInt_From_int(freenect_start_video(__pyx_v_dev->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2970  __Pyx_GOTREF(__pyx_t_1);
2971  __pyx_r = __pyx_t_1;
2972  __pyx_t_1 = 0;
2973  goto __pyx_L0;
2974 
2975  /* "freenect.pyx":240
2976  * return freenect_start_depth(dev._ptr)
2977  *
2978  * def start_video(DevPtr dev): # <<<<<<<<<<<<<<
2979  * return freenect_start_video(dev._ptr)
2980  *
2981  */
2982 
2983  /* function exit code */
2984  __pyx_L1_error:;
2985  __Pyx_XDECREF(__pyx_t_1);
2986  __Pyx_AddTraceback("freenect.start_video", __pyx_clineno, __pyx_lineno, __pyx_filename);
2987  __pyx_r = NULL;
2988  __pyx_L0:;
2989  __Pyx_XGIVEREF(__pyx_r);
2990  __Pyx_RefNannyFinishContext();
2991  return __pyx_r;
2992 }
2993 
2994 /* "freenect.pyx":243
2995  * return freenect_start_video(dev._ptr)
2996  *
2997  * def stop_depth(DevPtr dev): # <<<<<<<<<<<<<<
2998  * return freenect_stop_depth(dev._ptr)
2999  *
3000  */
3001 
3002 /* Python wrapper */
3003 static PyObject *__pyx_pw_8freenect_13stop_depth(PyObject *__pyx_self, PyObject *__pyx_v_dev); /*proto*/
3004 static PyMethodDef __pyx_mdef_8freenect_13stop_depth = {__Pyx_NAMESTR("stop_depth"), (PyCFunction)__pyx_pw_8freenect_13stop_depth, METH_O, __Pyx_DOCSTR(0)};
3005 static PyObject *__pyx_pw_8freenect_13stop_depth(PyObject *__pyx_self, PyObject *__pyx_v_dev) {
3006  CYTHON_UNUSED int __pyx_lineno = 0;
3007  CYTHON_UNUSED const char *__pyx_filename = NULL;
3008  CYTHON_UNUSED int __pyx_clineno = 0;
3009  PyObject *__pyx_r = 0;
3010  __Pyx_RefNannyDeclarations
3011  __Pyx_RefNannySetupContext("stop_depth (wrapper)", 0);
3012  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3013  __pyx_r = __pyx_pf_8freenect_12stop_depth(__pyx_self, ((struct __pyx_obj_8freenect_DevPtr *)__pyx_v_dev));
3014 
3015  /* function exit code */
3016  goto __pyx_L0;
3017  __pyx_L1_error:;
3018  __pyx_r = NULL;
3019  __pyx_L0:;
3020  __Pyx_RefNannyFinishContext();
3021  return __pyx_r;
3022 }
3023 
3024 static PyObject *__pyx_pf_8freenect_12stop_depth(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev) {
3025  PyObject *__pyx_r = NULL;
3026  __Pyx_RefNannyDeclarations
3027  PyObject *__pyx_t_1 = NULL;
3028  int __pyx_lineno = 0;
3029  const char *__pyx_filename = NULL;
3030  int __pyx_clineno = 0;
3031  __Pyx_RefNannySetupContext("stop_depth", 0);
3032 
3033  /* "freenect.pyx":244
3034  *
3035  * def stop_depth(DevPtr dev):
3036  * return freenect_stop_depth(dev._ptr) # <<<<<<<<<<<<<<
3037  *
3038  * def stop_video(DevPtr dev):
3039  */
3040  __Pyx_XDECREF(__pyx_r);
3041  __pyx_t_1 = __Pyx_PyInt_From_int(freenect_stop_depth(__pyx_v_dev->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3042  __Pyx_GOTREF(__pyx_t_1);
3043  __pyx_r = __pyx_t_1;
3044  __pyx_t_1 = 0;
3045  goto __pyx_L0;
3046 
3047  /* "freenect.pyx":243
3048  * return freenect_start_video(dev._ptr)
3049  *
3050  * def stop_depth(DevPtr dev): # <<<<<<<<<<<<<<
3051  * return freenect_stop_depth(dev._ptr)
3052  *
3053  */
3054 
3055  /* function exit code */
3056  __pyx_L1_error:;
3057  __Pyx_XDECREF(__pyx_t_1);
3058  __Pyx_AddTraceback("freenect.stop_depth", __pyx_clineno, __pyx_lineno, __pyx_filename);
3059  __pyx_r = NULL;
3060  __pyx_L0:;
3061  __Pyx_XGIVEREF(__pyx_r);
3062  __Pyx_RefNannyFinishContext();
3063  return __pyx_r;
3064 }
3065 
3066 /* "freenect.pyx":246
3067  * return freenect_stop_depth(dev._ptr)
3068  *
3069  * def stop_video(DevPtr dev): # <<<<<<<<<<<<<<
3070  * return freenect_stop_video(dev._ptr)
3071  *
3072  */
3073 
3074 /* Python wrapper */
3075 static PyObject *__pyx_pw_8freenect_15stop_video(PyObject *__pyx_self, PyObject *__pyx_v_dev); /*proto*/
3076 static PyMethodDef __pyx_mdef_8freenect_15stop_video = {__Pyx_NAMESTR("stop_video"), (PyCFunction)__pyx_pw_8freenect_15stop_video, METH_O, __Pyx_DOCSTR(0)};
3077 static PyObject *__pyx_pw_8freenect_15stop_video(PyObject *__pyx_self, PyObject *__pyx_v_dev) {
3078  CYTHON_UNUSED int __pyx_lineno = 0;
3079  CYTHON_UNUSED const char *__pyx_filename = NULL;
3080  CYTHON_UNUSED int __pyx_clineno = 0;
3081  PyObject *__pyx_r = 0;
3082  __Pyx_RefNannyDeclarations
3083  __Pyx_RefNannySetupContext("stop_video (wrapper)", 0);
3084  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3085  __pyx_r = __pyx_pf_8freenect_14stop_video(__pyx_self, ((struct __pyx_obj_8freenect_DevPtr *)__pyx_v_dev));
3086 
3087  /* function exit code */
3088  goto __pyx_L0;
3089  __pyx_L1_error:;
3090  __pyx_r = NULL;
3091  __pyx_L0:;
3092  __Pyx_RefNannyFinishContext();
3093  return __pyx_r;
3094 }
3095 
3096 static PyObject *__pyx_pf_8freenect_14stop_video(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev) {
3097  PyObject *__pyx_r = NULL;
3098  __Pyx_RefNannyDeclarations
3099  PyObject *__pyx_t_1 = NULL;
3100  int __pyx_lineno = 0;
3101  const char *__pyx_filename = NULL;
3102  int __pyx_clineno = 0;
3103  __Pyx_RefNannySetupContext("stop_video", 0);
3104 
3105  /* "freenect.pyx":247
3106  *
3107  * def stop_video(DevPtr dev):
3108  * return freenect_stop_video(dev._ptr) # <<<<<<<<<<<<<<
3109  *
3110  * def shutdown(CtxPtr ctx):
3111  */
3112  __Pyx_XDECREF(__pyx_r);
3113  __pyx_t_1 = __Pyx_PyInt_From_int(freenect_stop_video(__pyx_v_dev->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3114  __Pyx_GOTREF(__pyx_t_1);
3115  __pyx_r = __pyx_t_1;
3116  __pyx_t_1 = 0;
3117  goto __pyx_L0;
3118 
3119  /* "freenect.pyx":246
3120  * return freenect_stop_depth(dev._ptr)
3121  *
3122  * def stop_video(DevPtr dev): # <<<<<<<<<<<<<<
3123  * return freenect_stop_video(dev._ptr)
3124  *
3125  */
3126 
3127  /* function exit code */
3128  __pyx_L1_error:;
3129  __Pyx_XDECREF(__pyx_t_1);
3130  __Pyx_AddTraceback("freenect.stop_video", __pyx_clineno, __pyx_lineno, __pyx_filename);
3131  __pyx_r = NULL;
3132  __pyx_L0:;
3133  __Pyx_XGIVEREF(__pyx_r);
3134  __Pyx_RefNannyFinishContext();
3135  return __pyx_r;
3136 }
3137 
3138 /* "freenect.pyx":249
3139  * return freenect_stop_video(dev._ptr)
3140  *
3141  * def shutdown(CtxPtr ctx): # <<<<<<<<<<<<<<
3142  * return freenect_shutdown(ctx._ptr)
3143  *
3144  */
3145 
3146 /* Python wrapper */
3147 static PyObject *__pyx_pw_8freenect_17shutdown(PyObject *__pyx_self, PyObject *__pyx_v_ctx); /*proto*/
3148 static PyMethodDef __pyx_mdef_8freenect_17shutdown = {__Pyx_NAMESTR("shutdown"), (PyCFunction)__pyx_pw_8freenect_17shutdown, METH_O, __Pyx_DOCSTR(0)};
3149 static PyObject *__pyx_pw_8freenect_17shutdown(PyObject *__pyx_self, PyObject *__pyx_v_ctx) {
3150  CYTHON_UNUSED int __pyx_lineno = 0;
3151  CYTHON_UNUSED const char *__pyx_filename = NULL;
3152  CYTHON_UNUSED int __pyx_clineno = 0;
3153  PyObject *__pyx_r = 0;
3154  __Pyx_RefNannyDeclarations
3155  __Pyx_RefNannySetupContext("shutdown (wrapper)", 0);
3156  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_8freenect_CtxPtr, 1, "ctx", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3157  __pyx_r = __pyx_pf_8freenect_16shutdown(__pyx_self, ((struct __pyx_obj_8freenect_CtxPtr *)__pyx_v_ctx));
3158 
3159  /* function exit code */
3160  goto __pyx_L0;
3161  __pyx_L1_error:;
3162  __pyx_r = NULL;
3163  __pyx_L0:;
3164  __Pyx_RefNannyFinishContext();
3165  return __pyx_r;
3166 }
3167 
3168 static PyObject *__pyx_pf_8freenect_16shutdown(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx) {
3169  PyObject *__pyx_r = NULL;
3170  __Pyx_RefNannyDeclarations
3171  PyObject *__pyx_t_1 = NULL;
3172  int __pyx_lineno = 0;
3173  const char *__pyx_filename = NULL;
3174  int __pyx_clineno = 0;
3175  __Pyx_RefNannySetupContext("shutdown", 0);
3176 
3177  /* "freenect.pyx":250
3178  *
3179  * def shutdown(CtxPtr ctx):
3180  * return freenect_shutdown(ctx._ptr) # <<<<<<<<<<<<<<
3181  *
3182  * def process_events(CtxPtr ctx):
3183  */
3184  __Pyx_XDECREF(__pyx_r);
3185  __pyx_t_1 = __Pyx_PyInt_From_int(freenect_shutdown(__pyx_v_ctx->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3186  __Pyx_GOTREF(__pyx_t_1);
3187  __pyx_r = __pyx_t_1;
3188  __pyx_t_1 = 0;
3189  goto __pyx_L0;
3190 
3191  /* "freenect.pyx":249
3192  * return freenect_stop_video(dev._ptr)
3193  *
3194  * def shutdown(CtxPtr ctx): # <<<<<<<<<<<<<<
3195  * return freenect_shutdown(ctx._ptr)
3196  *
3197  */
3198 
3199  /* function exit code */
3200  __pyx_L1_error:;
3201  __Pyx_XDECREF(__pyx_t_1);
3202  __Pyx_AddTraceback("freenect.shutdown", __pyx_clineno, __pyx_lineno, __pyx_filename);
3203  __pyx_r = NULL;
3204  __pyx_L0:;
3205  __Pyx_XGIVEREF(__pyx_r);
3206  __Pyx_RefNannyFinishContext();
3207  return __pyx_r;
3208 }
3209 
3210 /* "freenect.pyx":252
3211  * return freenect_shutdown(ctx._ptr)
3212  *
3213  * def process_events(CtxPtr ctx): # <<<<<<<<<<<<<<
3214  * return freenect_process_events(ctx._ptr)
3215  *
3216  */
3217 
3218 /* Python wrapper */
3219 static PyObject *__pyx_pw_8freenect_19process_events(PyObject *__pyx_self, PyObject *__pyx_v_ctx); /*proto*/
3220 static PyMethodDef __pyx_mdef_8freenect_19process_events = {__Pyx_NAMESTR("process_events"), (PyCFunction)__pyx_pw_8freenect_19process_events, METH_O, __Pyx_DOCSTR(0)};
3221 static PyObject *__pyx_pw_8freenect_19process_events(PyObject *__pyx_self, PyObject *__pyx_v_ctx) {
3222  CYTHON_UNUSED int __pyx_lineno = 0;
3223  CYTHON_UNUSED const char *__pyx_filename = NULL;
3224  CYTHON_UNUSED int __pyx_clineno = 0;
3225  PyObject *__pyx_r = 0;
3226  __Pyx_RefNannyDeclarations
3227  __Pyx_RefNannySetupContext("process_events (wrapper)", 0);
3228  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_8freenect_CtxPtr, 1, "ctx", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3229  __pyx_r = __pyx_pf_8freenect_18process_events(__pyx_self, ((struct __pyx_obj_8freenect_CtxPtr *)__pyx_v_ctx));
3230 
3231  /* function exit code */
3232  goto __pyx_L0;
3233  __pyx_L1_error:;
3234  __pyx_r = NULL;
3235  __pyx_L0:;
3236  __Pyx_RefNannyFinishContext();
3237  return __pyx_r;
3238 }
3239 
3240 static PyObject *__pyx_pf_8freenect_18process_events(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx) {
3241  PyObject *__pyx_r = NULL;
3242  __Pyx_RefNannyDeclarations
3243  PyObject *__pyx_t_1 = NULL;
3244  int __pyx_lineno = 0;
3245  const char *__pyx_filename = NULL;
3246  int __pyx_clineno = 0;
3247  __Pyx_RefNannySetupContext("process_events", 0);
3248 
3249  /* "freenect.pyx":253
3250  *
3251  * def process_events(CtxPtr ctx):
3252  * return freenect_process_events(ctx._ptr) # <<<<<<<<<<<<<<
3253  *
3254  * def num_devices(CtxPtr ctx):
3255  */
3256  __Pyx_XDECREF(__pyx_r);
3257  __pyx_t_1 = __Pyx_PyInt_From_int(freenect_process_events(__pyx_v_ctx->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3258  __Pyx_GOTREF(__pyx_t_1);
3259  __pyx_r = __pyx_t_1;
3260  __pyx_t_1 = 0;
3261  goto __pyx_L0;
3262 
3263  /* "freenect.pyx":252
3264  * return freenect_shutdown(ctx._ptr)
3265  *
3266  * def process_events(CtxPtr ctx): # <<<<<<<<<<<<<<
3267  * return freenect_process_events(ctx._ptr)
3268  *
3269  */
3270 
3271  /* function exit code */
3272  __pyx_L1_error:;
3273  __Pyx_XDECREF(__pyx_t_1);
3274  __Pyx_AddTraceback("freenect.process_events", __pyx_clineno, __pyx_lineno, __pyx_filename);
3275  __pyx_r = NULL;
3276  __pyx_L0:;
3277  __Pyx_XGIVEREF(__pyx_r);
3278  __Pyx_RefNannyFinishContext();
3279  return __pyx_r;
3280 }
3281 
3282 /* "freenect.pyx":255
3283  * return freenect_process_events(ctx._ptr)
3284  *
3285  * def num_devices(CtxPtr ctx): # <<<<<<<<<<<<<<
3286  * return freenect_num_devices(ctx._ptr)
3287  *
3288  */
3289 
3290 /* Python wrapper */
3291 static PyObject *__pyx_pw_8freenect_21num_devices(PyObject *__pyx_self, PyObject *__pyx_v_ctx); /*proto*/
3292 static PyMethodDef __pyx_mdef_8freenect_21num_devices = {__Pyx_NAMESTR("num_devices"), (PyCFunction)__pyx_pw_8freenect_21num_devices, METH_O, __Pyx_DOCSTR(0)};
3293 static PyObject *__pyx_pw_8freenect_21num_devices(PyObject *__pyx_self, PyObject *__pyx_v_ctx) {
3294  CYTHON_UNUSED int __pyx_lineno = 0;
3295  CYTHON_UNUSED const char *__pyx_filename = NULL;
3296  CYTHON_UNUSED int __pyx_clineno = 0;
3297  PyObject *__pyx_r = 0;
3298  __Pyx_RefNannyDeclarations
3299  __Pyx_RefNannySetupContext("num_devices (wrapper)", 0);
3300  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_8freenect_CtxPtr, 1, "ctx", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3301  __pyx_r = __pyx_pf_8freenect_20num_devices(__pyx_self, ((struct __pyx_obj_8freenect_CtxPtr *)__pyx_v_ctx));
3302 
3303  /* function exit code */
3304  goto __pyx_L0;
3305  __pyx_L1_error:;
3306  __pyx_r = NULL;
3307  __pyx_L0:;
3308  __Pyx_RefNannyFinishContext();
3309  return __pyx_r;
3310 }
3311 
3312 static PyObject *__pyx_pf_8freenect_20num_devices(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx) {
3313  PyObject *__pyx_r = NULL;
3314  __Pyx_RefNannyDeclarations
3315  PyObject *__pyx_t_1 = NULL;
3316  int __pyx_lineno = 0;
3317  const char *__pyx_filename = NULL;
3318  int __pyx_clineno = 0;
3319  __Pyx_RefNannySetupContext("num_devices", 0);
3320 
3321  /* "freenect.pyx":256
3322  *
3323  * def num_devices(CtxPtr ctx):
3324  * return freenect_num_devices(ctx._ptr) # <<<<<<<<<<<<<<
3325  *
3326  * def close_device(DevPtr dev):
3327  */
3328  __Pyx_XDECREF(__pyx_r);
3329  __pyx_t_1 = __Pyx_PyInt_From_int(freenect_num_devices(__pyx_v_ctx->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3330  __Pyx_GOTREF(__pyx_t_1);
3331  __pyx_r = __pyx_t_1;
3332  __pyx_t_1 = 0;
3333  goto __pyx_L0;
3334 
3335  /* "freenect.pyx":255
3336  * return freenect_process_events(ctx._ptr)
3337  *
3338  * def num_devices(CtxPtr ctx): # <<<<<<<<<<<<<<
3339  * return freenect_num_devices(ctx._ptr)
3340  *
3341  */
3342 
3343  /* function exit code */
3344  __pyx_L1_error:;
3345  __Pyx_XDECREF(__pyx_t_1);
3346  __Pyx_AddTraceback("freenect.num_devices", __pyx_clineno, __pyx_lineno, __pyx_filename);
3347  __pyx_r = NULL;
3348  __pyx_L0:;
3349  __Pyx_XGIVEREF(__pyx_r);
3350  __Pyx_RefNannyFinishContext();
3351  return __pyx_r;
3352 }
3353 
3354 /* "freenect.pyx":258
3355  * return freenect_num_devices(ctx._ptr)
3356  *
3357  * def close_device(DevPtr dev): # <<<<<<<<<<<<<<
3358  * return freenect_close_device(dev._ptr)
3359  *
3360  */
3361 
3362 /* Python wrapper */
3363 static PyObject *__pyx_pw_8freenect_23close_device(PyObject *__pyx_self, PyObject *__pyx_v_dev); /*proto*/
3364 static PyMethodDef __pyx_mdef_8freenect_23close_device = {__Pyx_NAMESTR("close_device"), (PyCFunction)__pyx_pw_8freenect_23close_device, METH_O, __Pyx_DOCSTR(0)};
3365 static PyObject *__pyx_pw_8freenect_23close_device(PyObject *__pyx_self, PyObject *__pyx_v_dev) {
3366  CYTHON_UNUSED int __pyx_lineno = 0;
3367  CYTHON_UNUSED const char *__pyx_filename = NULL;
3368  CYTHON_UNUSED int __pyx_clineno = 0;
3369  PyObject *__pyx_r = 0;
3370  __Pyx_RefNannyDeclarations
3371  __Pyx_RefNannySetupContext("close_device (wrapper)", 0);
3372  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3373  __pyx_r = __pyx_pf_8freenect_22close_device(__pyx_self, ((struct __pyx_obj_8freenect_DevPtr *)__pyx_v_dev));
3374 
3375  /* function exit code */
3376  goto __pyx_L0;
3377  __pyx_L1_error:;
3378  __pyx_r = NULL;
3379  __pyx_L0:;
3380  __Pyx_RefNannyFinishContext();
3381  return __pyx_r;
3382 }
3383 
3384 static PyObject *__pyx_pf_8freenect_22close_device(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev) {
3385  PyObject *__pyx_r = NULL;
3386  __Pyx_RefNannyDeclarations
3387  PyObject *__pyx_t_1 = NULL;
3388  int __pyx_lineno = 0;
3389  const char *__pyx_filename = NULL;
3390  int __pyx_clineno = 0;
3391  __Pyx_RefNannySetupContext("close_device", 0);
3392 
3393  /* "freenect.pyx":259
3394  *
3395  * def close_device(DevPtr dev):
3396  * return freenect_close_device(dev._ptr) # <<<<<<<<<<<<<<
3397  *
3398  * def set_tilt_degs(DevPtr dev, float angle):
3399  */
3400  __Pyx_XDECREF(__pyx_r);
3401  __pyx_t_1 = __Pyx_PyInt_From_int(freenect_close_device(__pyx_v_dev->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3402  __Pyx_GOTREF(__pyx_t_1);
3403  __pyx_r = __pyx_t_1;
3404  __pyx_t_1 = 0;
3405  goto __pyx_L0;
3406 
3407  /* "freenect.pyx":258
3408  * return freenect_num_devices(ctx._ptr)
3409  *
3410  * def close_device(DevPtr dev): # <<<<<<<<<<<<<<
3411  * return freenect_close_device(dev._ptr)
3412  *
3413  */
3414 
3415  /* function exit code */
3416  __pyx_L1_error:;
3417  __Pyx_XDECREF(__pyx_t_1);
3418  __Pyx_AddTraceback("freenect.close_device", __pyx_clineno, __pyx_lineno, __pyx_filename);
3419  __pyx_r = NULL;
3420  __pyx_L0:;
3421  __Pyx_XGIVEREF(__pyx_r);
3422  __Pyx_RefNannyFinishContext();
3423  return __pyx_r;
3424 }
3425 
3426 /* "freenect.pyx":261
3427  * return freenect_close_device(dev._ptr)
3428  *
3429  * def set_tilt_degs(DevPtr dev, float angle): # <<<<<<<<<<<<<<
3430  * freenect_set_tilt_degs(dev._ptr, angle)
3431  *
3432  */
3433 
3434 /* Python wrapper */
3435 static PyObject *__pyx_pw_8freenect_25set_tilt_degs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3436 static PyMethodDef __pyx_mdef_8freenect_25set_tilt_degs = {__Pyx_NAMESTR("set_tilt_degs"), (PyCFunction)__pyx_pw_8freenect_25set_tilt_degs, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
3437 static PyObject *__pyx_pw_8freenect_25set_tilt_degs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3438  struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev = 0;
3439  float __pyx_v_angle;
3440  int __pyx_lineno = 0;
3441  const char *__pyx_filename = NULL;
3442  int __pyx_clineno = 0;
3443  PyObject *__pyx_r = 0;
3444  __Pyx_RefNannyDeclarations
3445  __Pyx_RefNannySetupContext("set_tilt_degs (wrapper)", 0);
3446  {
3447  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dev,&__pyx_n_s_angle,0};
3448  PyObject* values[2] = {0,0};
3449  if (unlikely(__pyx_kwds)) {
3450  Py_ssize_t kw_args;
3451  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3452  switch (pos_args) {
3453  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3454  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3455  case 0: break;
3456  default: goto __pyx_L5_argtuple_error;
3457  }
3458  kw_args = PyDict_Size(__pyx_kwds);
3459  switch (pos_args) {
3460  case 0:
3461  if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev)) != 0)) kw_args--;
3462  else goto __pyx_L5_argtuple_error;
3463  case 1:
3464  if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_angle)) != 0)) kw_args--;
3465  else {
3466  __Pyx_RaiseArgtupleInvalid("set_tilt_degs", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3467  }
3468  }
3469  if (unlikely(kw_args > 0)) {
3470  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_tilt_degs") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3471  }
3472  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3473  goto __pyx_L5_argtuple_error;
3474  } else {
3475  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3476  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3477  }
3478  __pyx_v_dev = ((struct __pyx_obj_8freenect_DevPtr *)values[0]);
3479  __pyx_v_angle = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_angle == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3480  }
3481  goto __pyx_L4_argument_unpacking_done;
3482  __pyx_L5_argtuple_error:;
3483  __Pyx_RaiseArgtupleInvalid("set_tilt_degs", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3484  __pyx_L3_error:;
3485  __Pyx_AddTraceback("freenect.set_tilt_degs", __pyx_clineno, __pyx_lineno, __pyx_filename);
3486  __Pyx_RefNannyFinishContext();
3487  return NULL;
3488  __pyx_L4_argument_unpacking_done:;
3489  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3490  __pyx_r = __pyx_pf_8freenect_24set_tilt_degs(__pyx_self, __pyx_v_dev, __pyx_v_angle);
3491 
3492  /* function exit code */
3493  goto __pyx_L0;
3494  __pyx_L1_error:;
3495  __pyx_r = NULL;
3496  __pyx_L0:;
3497  __Pyx_RefNannyFinishContext();
3498  return __pyx_r;
3499 }
3500 
3501 static PyObject *__pyx_pf_8freenect_24set_tilt_degs(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev, float __pyx_v_angle) {
3502  PyObject *__pyx_r = NULL;
3503  __Pyx_RefNannyDeclarations
3504  __Pyx_RefNannySetupContext("set_tilt_degs", 0);
3505 
3506  /* "freenect.pyx":262
3507  *
3508  * def set_tilt_degs(DevPtr dev, float angle):
3509  * freenect_set_tilt_degs(dev._ptr, angle) # <<<<<<<<<<<<<<
3510  *
3511  * def set_led(DevPtr dev, freenect_led_options option):
3512  */
3513  freenect_set_tilt_degs(__pyx_v_dev->_ptr, __pyx_v_angle);
3514 
3515  /* "freenect.pyx":261
3516  * return freenect_close_device(dev._ptr)
3517  *
3518  * def set_tilt_degs(DevPtr dev, float angle): # <<<<<<<<<<<<<<
3519  * freenect_set_tilt_degs(dev._ptr, angle)
3520  *
3521  */
3522 
3523  /* function exit code */
3524  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3525  __Pyx_XGIVEREF(__pyx_r);
3526  __Pyx_RefNannyFinishContext();
3527  return __pyx_r;
3528 }
3529 
3530 /* "freenect.pyx":264
3531  * freenect_set_tilt_degs(dev._ptr, angle)
3532  *
3533  * def set_led(DevPtr dev, freenect_led_options option): # <<<<<<<<<<<<<<
3534  * return freenect_set_led(dev._ptr, option)
3535  *
3536  */
3537 
3538 /* Python wrapper */
3539 static PyObject *__pyx_pw_8freenect_27set_led(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3540 static PyMethodDef __pyx_mdef_8freenect_27set_led = {__Pyx_NAMESTR("set_led"), (PyCFunction)__pyx_pw_8freenect_27set_led, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
3541 static PyObject *__pyx_pw_8freenect_27set_led(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3542  struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev = 0;
3543  freenect_led_options __pyx_v_option;
3544  int __pyx_lineno = 0;
3545  const char *__pyx_filename = NULL;
3546  int __pyx_clineno = 0;
3547  PyObject *__pyx_r = 0;
3548  __Pyx_RefNannyDeclarations
3549  __Pyx_RefNannySetupContext("set_led (wrapper)", 0);
3550  {
3551  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dev,&__pyx_n_s_option,0};
3552  PyObject* values[2] = {0,0};
3553  if (unlikely(__pyx_kwds)) {
3554  Py_ssize_t kw_args;
3555  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3556  switch (pos_args) {
3557  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3558  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3559  case 0: break;
3560  default: goto __pyx_L5_argtuple_error;
3561  }
3562  kw_args = PyDict_Size(__pyx_kwds);
3563  switch (pos_args) {
3564  case 0:
3565  if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev)) != 0)) kw_args--;
3566  else goto __pyx_L5_argtuple_error;
3567  case 1:
3568  if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_option)) != 0)) kw_args--;
3569  else {
3570  __Pyx_RaiseArgtupleInvalid("set_led", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3571  }
3572  }
3573  if (unlikely(kw_args > 0)) {
3574  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_led") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3575  }
3576  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3577  goto __pyx_L5_argtuple_error;
3578  } else {
3579  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3580  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3581  }
3582  __pyx_v_dev = ((struct __pyx_obj_8freenect_DevPtr *)values[0]);
3583  __pyx_v_option = ((freenect_led_options)PyInt_AsLong(values[1])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3584  }
3585  goto __pyx_L4_argument_unpacking_done;
3586  __pyx_L5_argtuple_error:;
3587  __Pyx_RaiseArgtupleInvalid("set_led", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3588  __pyx_L3_error:;
3589  __Pyx_AddTraceback("freenect.set_led", __pyx_clineno, __pyx_lineno, __pyx_filename);
3590  __Pyx_RefNannyFinishContext();
3591  return NULL;
3592  __pyx_L4_argument_unpacking_done:;
3593  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3594  __pyx_r = __pyx_pf_8freenect_26set_led(__pyx_self, __pyx_v_dev, __pyx_v_option);
3595 
3596  /* function exit code */
3597  goto __pyx_L0;
3598  __pyx_L1_error:;
3599  __pyx_r = NULL;
3600  __pyx_L0:;
3601  __Pyx_RefNannyFinishContext();
3602  return __pyx_r;
3603 }
3604 
3605 static PyObject *__pyx_pf_8freenect_26set_led(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev, freenect_led_options __pyx_v_option) {
3606  PyObject *__pyx_r = NULL;
3607  __Pyx_RefNannyDeclarations
3608  PyObject *__pyx_t_1 = NULL;
3609  int __pyx_lineno = 0;
3610  const char *__pyx_filename = NULL;
3611  int __pyx_clineno = 0;
3612  __Pyx_RefNannySetupContext("set_led", 0);
3613 
3614  /* "freenect.pyx":265
3615  *
3616  * def set_led(DevPtr dev, freenect_led_options option):
3617  * return freenect_set_led(dev._ptr, option) # <<<<<<<<<<<<<<
3618  *
3619  * def update_tilt_state(DevPtr dev):
3620  */
3621  __Pyx_XDECREF(__pyx_r);
3622  __pyx_t_1 = __Pyx_PyInt_From_int(freenect_set_led(__pyx_v_dev->_ptr, __pyx_v_option)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3623  __Pyx_GOTREF(__pyx_t_1);
3624  __pyx_r = __pyx_t_1;
3625  __pyx_t_1 = 0;
3626  goto __pyx_L0;
3627 
3628  /* "freenect.pyx":264
3629  * freenect_set_tilt_degs(dev._ptr, angle)
3630  *
3631  * def set_led(DevPtr dev, freenect_led_options option): # <<<<<<<<<<<<<<
3632  * return freenect_set_led(dev._ptr, option)
3633  *
3634  */
3635 
3636  /* function exit code */
3637  __pyx_L1_error:;
3638  __Pyx_XDECREF(__pyx_t_1);
3639  __Pyx_AddTraceback("freenect.set_led", __pyx_clineno, __pyx_lineno, __pyx_filename);
3640  __pyx_r = NULL;
3641  __pyx_L0:;
3642  __Pyx_XGIVEREF(__pyx_r);
3643  __Pyx_RefNannyFinishContext();
3644  return __pyx_r;
3645 }
3646 
3647 /* "freenect.pyx":267
3648  * return freenect_set_led(dev._ptr, option)
3649  *
3650  * def update_tilt_state(DevPtr dev): # <<<<<<<<<<<<<<
3651  * return freenect_update_tilt_state(dev._ptr)
3652  *
3653  */
3654 
3655 /* Python wrapper */
3656 static PyObject *__pyx_pw_8freenect_29update_tilt_state(PyObject *__pyx_self, PyObject *__pyx_v_dev); /*proto*/
3657 static PyMethodDef __pyx_mdef_8freenect_29update_tilt_state = {__Pyx_NAMESTR("update_tilt_state"), (PyCFunction)__pyx_pw_8freenect_29update_tilt_state, METH_O, __Pyx_DOCSTR(0)};
3658 static PyObject *__pyx_pw_8freenect_29update_tilt_state(PyObject *__pyx_self, PyObject *__pyx_v_dev) {
3659  CYTHON_UNUSED int __pyx_lineno = 0;
3660  CYTHON_UNUSED const char *__pyx_filename = NULL;
3661  CYTHON_UNUSED int __pyx_clineno = 0;
3662  PyObject *__pyx_r = 0;
3663  __Pyx_RefNannyDeclarations
3664  __Pyx_RefNannySetupContext("update_tilt_state (wrapper)", 0);
3665  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3666  __pyx_r = __pyx_pf_8freenect_28update_tilt_state(__pyx_self, ((struct __pyx_obj_8freenect_DevPtr *)__pyx_v_dev));
3667 
3668  /* function exit code */
3669  goto __pyx_L0;
3670  __pyx_L1_error:;
3671  __pyx_r = NULL;
3672  __pyx_L0:;
3673  __Pyx_RefNannyFinishContext();
3674  return __pyx_r;
3675 }
3676 
3677 static PyObject *__pyx_pf_8freenect_28update_tilt_state(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev) {
3678  PyObject *__pyx_r = NULL;
3679  __Pyx_RefNannyDeclarations
3680  PyObject *__pyx_t_1 = NULL;
3681  int __pyx_lineno = 0;
3682  const char *__pyx_filename = NULL;
3683  int __pyx_clineno = 0;
3684  __Pyx_RefNannySetupContext("update_tilt_state", 0);
3685 
3686  /* "freenect.pyx":268
3687  *
3688  * def update_tilt_state(DevPtr dev):
3689  * return freenect_update_tilt_state(dev._ptr) # <<<<<<<<<<<<<<
3690  *
3691  * def get_tilt_state(DevPtr dev):
3692  */
3693  __Pyx_XDECREF(__pyx_r);
3694  __pyx_t_1 = __Pyx_PyInt_From_int(freenect_update_tilt_state(__pyx_v_dev->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3695  __Pyx_GOTREF(__pyx_t_1);
3696  __pyx_r = __pyx_t_1;
3697  __pyx_t_1 = 0;
3698  goto __pyx_L0;
3699 
3700  /* "freenect.pyx":267
3701  * return freenect_set_led(dev._ptr, option)
3702  *
3703  * def update_tilt_state(DevPtr dev): # <<<<<<<<<<<<<<
3704  * return freenect_update_tilt_state(dev._ptr)
3705  *
3706  */
3707 
3708  /* function exit code */
3709  __pyx_L1_error:;
3710  __Pyx_XDECREF(__pyx_t_1);
3711  __Pyx_AddTraceback("freenect.update_tilt_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
3712  __pyx_r = NULL;
3713  __pyx_L0:;
3714  __Pyx_XGIVEREF(__pyx_r);
3715  __Pyx_RefNannyFinishContext();
3716  return __pyx_r;
3717 }
3718 
3719 /* "freenect.pyx":270
3720  * return freenect_update_tilt_state(dev._ptr)
3721  *
3722  * def get_tilt_state(DevPtr dev): # <<<<<<<<<<<<<<
3723  * cdef freenect_raw_tilt_state* state = freenect_get_tilt_state(dev._ptr)
3724  * cdef StatePtr state_out = StatePtr.__new__(StatePtr)
3725  */
3726 
3727 /* Python wrapper */
3728 static PyObject *__pyx_pw_8freenect_31get_tilt_state(PyObject *__pyx_self, PyObject *__pyx_v_dev); /*proto*/
3729 static PyMethodDef __pyx_mdef_8freenect_31get_tilt_state = {__Pyx_NAMESTR("get_tilt_state"), (PyCFunction)__pyx_pw_8freenect_31get_tilt_state, METH_O, __Pyx_DOCSTR(0)};
3730 static PyObject *__pyx_pw_8freenect_31get_tilt_state(PyObject *__pyx_self, PyObject *__pyx_v_dev) {
3731  CYTHON_UNUSED int __pyx_lineno = 0;
3732  CYTHON_UNUSED const char *__pyx_filename = NULL;
3733  CYTHON_UNUSED int __pyx_clineno = 0;
3734  PyObject *__pyx_r = 0;
3735  __Pyx_RefNannyDeclarations
3736  __Pyx_RefNannySetupContext("get_tilt_state (wrapper)", 0);
3737  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3738  __pyx_r = __pyx_pf_8freenect_30get_tilt_state(__pyx_self, ((struct __pyx_obj_8freenect_DevPtr *)__pyx_v_dev));
3739 
3740  /* function exit code */
3741  goto __pyx_L0;
3742  __pyx_L1_error:;
3743  __pyx_r = NULL;
3744  __pyx_L0:;
3745  __Pyx_RefNannyFinishContext();
3746  return __pyx_r;
3747 }
3748 
3749 static PyObject *__pyx_pf_8freenect_30get_tilt_state(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev) {
3750  freenect_raw_tilt_state *__pyx_v_state;
3751  struct __pyx_obj_8freenect_StatePtr *__pyx_v_state_out = 0;
3752  PyObject *__pyx_r = NULL;
3753  __Pyx_RefNannyDeclarations
3754  PyObject *__pyx_t_1 = NULL;
3755  int __pyx_lineno = 0;
3756  const char *__pyx_filename = NULL;
3757  int __pyx_clineno = 0;
3758  __Pyx_RefNannySetupContext("get_tilt_state", 0);
3759 
3760  /* "freenect.pyx":271
3761  *
3762  * def get_tilt_state(DevPtr dev):
3763  * cdef freenect_raw_tilt_state* state = freenect_get_tilt_state(dev._ptr) # <<<<<<<<<<<<<<
3764  * cdef StatePtr state_out = StatePtr.__new__(StatePtr)
3765  * state_out._ptr = state
3766  */
3767  __pyx_v_state = freenect_get_tilt_state(__pyx_v_dev->_ptr);
3768 
3769  /* "freenect.pyx":272
3770  * def get_tilt_state(DevPtr dev):
3771  * cdef freenect_raw_tilt_state* state = freenect_get_tilt_state(dev._ptr)
3772  * cdef StatePtr state_out = StatePtr.__new__(StatePtr) # <<<<<<<<<<<<<<
3773  * state_out._ptr = state
3774  * return state_out
3775  */
3776  __pyx_t_1 = __pyx_tp_new_8freenect_StatePtr(((PyTypeObject *)((PyObject*)__pyx_ptype_8freenect_StatePtr)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3777  __Pyx_GOTREF(__pyx_t_1);
3778  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_8freenect_StatePtr)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3779  __pyx_v_state_out = ((struct __pyx_obj_8freenect_StatePtr *)__pyx_t_1);
3780  __pyx_t_1 = 0;
3781 
3782  /* "freenect.pyx":273
3783  * cdef freenect_raw_tilt_state* state = freenect_get_tilt_state(dev._ptr)
3784  * cdef StatePtr state_out = StatePtr.__new__(StatePtr)
3785  * state_out._ptr = state # <<<<<<<<<<<<<<
3786  * return state_out
3787  *
3788  */
3789  __pyx_v_state_out->_ptr = __pyx_v_state;
3790 
3791  /* "freenect.pyx":274
3792  * cdef StatePtr state_out = StatePtr.__new__(StatePtr)
3793  * state_out._ptr = state
3794  * return state_out # <<<<<<<<<<<<<<
3795  *
3796  * def get_mks_accel(StatePtr state):
3797  */
3798  __Pyx_XDECREF(__pyx_r);
3799  __Pyx_INCREF(((PyObject *)__pyx_v_state_out));
3800  __pyx_r = ((PyObject *)__pyx_v_state_out);
3801  goto __pyx_L0;
3802 
3803  /* "freenect.pyx":270
3804  * return freenect_update_tilt_state(dev._ptr)
3805  *
3806  * def get_tilt_state(DevPtr dev): # <<<<<<<<<<<<<<
3807  * cdef freenect_raw_tilt_state* state = freenect_get_tilt_state(dev._ptr)
3808  * cdef StatePtr state_out = StatePtr.__new__(StatePtr)
3809  */
3810 
3811  /* function exit code */
3812  __pyx_L1_error:;
3813  __Pyx_XDECREF(__pyx_t_1);
3814  __Pyx_AddTraceback("freenect.get_tilt_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
3815  __pyx_r = NULL;
3816  __pyx_L0:;
3817  __Pyx_XDECREF((PyObject *)__pyx_v_state_out);
3818  __Pyx_XGIVEREF(__pyx_r);
3819  __Pyx_RefNannyFinishContext();
3820  return __pyx_r;
3821 }
3822 
3823 /* "freenect.pyx":276
3824  * return state_out
3825  *
3826  * def get_mks_accel(StatePtr state): # <<<<<<<<<<<<<<
3827  * cdef double x, y, z
3828  * freenect_get_mks_accel(state._ptr, &x, &y, &z)
3829  */
3830 
3831 /* Python wrapper */
3832 static PyObject *__pyx_pw_8freenect_33get_mks_accel(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/
3833 static PyMethodDef __pyx_mdef_8freenect_33get_mks_accel = {__Pyx_NAMESTR("get_mks_accel"), (PyCFunction)__pyx_pw_8freenect_33get_mks_accel, METH_O, __Pyx_DOCSTR(0)};
3834 static PyObject *__pyx_pw_8freenect_33get_mks_accel(PyObject *__pyx_self, PyObject *__pyx_v_state) {
3835  CYTHON_UNUSED int __pyx_lineno = 0;
3836  CYTHON_UNUSED const char *__pyx_filename = NULL;
3837  CYTHON_UNUSED int __pyx_clineno = 0;
3838  PyObject *__pyx_r = 0;
3839  __Pyx_RefNannyDeclarations
3840  __Pyx_RefNannySetupContext("get_mks_accel (wrapper)", 0);
3841  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_8freenect_StatePtr, 1, "state", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3842  __pyx_r = __pyx_pf_8freenect_32get_mks_accel(__pyx_self, ((struct __pyx_obj_8freenect_StatePtr *)__pyx_v_state));
3843 
3844  /* function exit code */
3845  goto __pyx_L0;
3846  __pyx_L1_error:;
3847  __pyx_r = NULL;
3848  __pyx_L0:;
3849  __Pyx_RefNannyFinishContext();
3850  return __pyx_r;
3851 }
3852 
3853 static PyObject *__pyx_pf_8freenect_32get_mks_accel(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_StatePtr *__pyx_v_state) {
3854  double __pyx_v_x;
3855  double __pyx_v_y;
3856  double __pyx_v_z;
3857  PyObject *__pyx_r = NULL;
3858  __Pyx_RefNannyDeclarations
3859  PyObject *__pyx_t_1 = NULL;
3860  PyObject *__pyx_t_2 = NULL;
3861  PyObject *__pyx_t_3 = NULL;
3862  PyObject *__pyx_t_4 = NULL;
3863  int __pyx_lineno = 0;
3864  const char *__pyx_filename = NULL;
3865  int __pyx_clineno = 0;
3866  __Pyx_RefNannySetupContext("get_mks_accel", 0);
3867 
3868  /* "freenect.pyx":278
3869  * def get_mks_accel(StatePtr state):
3870  * cdef double x, y, z
3871  * freenect_get_mks_accel(state._ptr, &x, &y, &z) # <<<<<<<<<<<<<<
3872  * return x, y, z
3873  *
3874  */
3875  freenect_get_mks_accel(__pyx_v_state->_ptr, (&__pyx_v_x), (&__pyx_v_y), (&__pyx_v_z));
3876 
3877  /* "freenect.pyx":279
3878  * cdef double x, y, z
3879  * freenect_get_mks_accel(state._ptr, &x, &y, &z)
3880  * return x, y, z # <<<<<<<<<<<<<<
3881  *
3882  * def get_accel(DevPtr dev):
3883  */
3884  __Pyx_XDECREF(__pyx_r);
3885  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_x); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3886  __Pyx_GOTREF(__pyx_t_1);
3887  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3888  __Pyx_GOTREF(__pyx_t_2);
3889  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_z); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3890  __Pyx_GOTREF(__pyx_t_3);
3891  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3892  __Pyx_GOTREF(__pyx_t_4);
3893  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
3894  __Pyx_GIVEREF(__pyx_t_1);
3895  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
3896  __Pyx_GIVEREF(__pyx_t_2);
3897  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
3898  __Pyx_GIVEREF(__pyx_t_3);
3899  __pyx_t_1 = 0;
3900  __pyx_t_2 = 0;
3901  __pyx_t_3 = 0;
3902  __pyx_r = __pyx_t_4;
3903  __pyx_t_4 = 0;
3904  goto __pyx_L0;
3905 
3906  /* "freenect.pyx":276
3907  * return state_out
3908  *
3909  * def get_mks_accel(StatePtr state): # <<<<<<<<<<<<<<
3910  * cdef double x, y, z
3911  * freenect_get_mks_accel(state._ptr, &x, &y, &z)
3912  */
3913 
3914  /* function exit code */
3915  __pyx_L1_error:;
3916  __Pyx_XDECREF(__pyx_t_1);
3917  __Pyx_XDECREF(__pyx_t_2);
3918  __Pyx_XDECREF(__pyx_t_3);
3919  __Pyx_XDECREF(__pyx_t_4);
3920  __Pyx_AddTraceback("freenect.get_mks_accel", __pyx_clineno, __pyx_lineno, __pyx_filename);
3921  __pyx_r = NULL;
3922  __pyx_L0:;
3923  __Pyx_XGIVEREF(__pyx_r);
3924  __Pyx_RefNannyFinishContext();
3925  return __pyx_r;
3926 }
3927 
3928 /* "freenect.pyx":281
3929  * return x, y, z
3930  *
3931  * def get_accel(DevPtr dev): # <<<<<<<<<<<<<<
3932  * """MKS Accelerometer helper
3933  *
3934  */
3935 
3936 /* Python wrapper */
3937 static PyObject *__pyx_pw_8freenect_35get_accel(PyObject *__pyx_self, PyObject *__pyx_v_dev); /*proto*/
3938 static char __pyx_doc_8freenect_34get_accel[] = "MKS Accelerometer helper\n\n Args:\n dev:\n\n Returns:\n (x, y, z) accelerometer values\n ";
3939 static PyMethodDef __pyx_mdef_8freenect_35get_accel = {__Pyx_NAMESTR("get_accel"), (PyCFunction)__pyx_pw_8freenect_35get_accel, METH_O, __Pyx_DOCSTR(__pyx_doc_8freenect_34get_accel)};
3940 static PyObject *__pyx_pw_8freenect_35get_accel(PyObject *__pyx_self, PyObject *__pyx_v_dev) {
3941  CYTHON_UNUSED int __pyx_lineno = 0;
3942  CYTHON_UNUSED const char *__pyx_filename = NULL;
3943  CYTHON_UNUSED int __pyx_clineno = 0;
3944  PyObject *__pyx_r = 0;
3945  __Pyx_RefNannyDeclarations
3946  __Pyx_RefNannySetupContext("get_accel (wrapper)", 0);
3947  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3948  __pyx_r = __pyx_pf_8freenect_34get_accel(__pyx_self, ((struct __pyx_obj_8freenect_DevPtr *)__pyx_v_dev));
3949 
3950  /* function exit code */
3951  goto __pyx_L0;
3952  __pyx_L1_error:;
3953  __pyx_r = NULL;
3954  __pyx_L0:;
3955  __Pyx_RefNannyFinishContext();
3956  return __pyx_r;
3957 }
3958 
3959 static PyObject *__pyx_pf_8freenect_34get_accel(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev) {
3960  PyObject *__pyx_r = NULL;
3961  __Pyx_RefNannyDeclarations
3962  PyObject *__pyx_t_1 = NULL;
3963  PyObject *__pyx_t_2 = NULL;
3964  PyObject *__pyx_t_3 = NULL;
3965  PyObject *__pyx_t_4 = NULL;
3966  int __pyx_lineno = 0;
3967  const char *__pyx_filename = NULL;
3968  int __pyx_clineno = 0;
3969  __Pyx_RefNannySetupContext("get_accel", 0);
3970 
3971  /* "freenect.pyx":290
3972  * (x, y, z) accelerometer values
3973  * """
3974  * update_tilt_state(dev) # <<<<<<<<<<<<<<
3975  * return get_mks_accel(get_tilt_state(dev))
3976  *
3977  */
3978  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_update_tilt_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3979  __Pyx_GOTREF(__pyx_t_1);
3980  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3981  __Pyx_GOTREF(__pyx_t_2);
3982  __Pyx_INCREF(((PyObject *)__pyx_v_dev));
3983  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_dev));
3984  __Pyx_GIVEREF(((PyObject *)__pyx_v_dev));
3985  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3986  __Pyx_GOTREF(__pyx_t_3);
3987  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3988  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3989  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3990 
3991  /* "freenect.pyx":291
3992  * """
3993  * update_tilt_state(dev)
3994  * return get_mks_accel(get_tilt_state(dev)) # <<<<<<<<<<<<<<
3995  *
3996  *
3997  */
3998  __Pyx_XDECREF(__pyx_r);
3999  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_mks_accel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4000  __Pyx_GOTREF(__pyx_t_3);
4001  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_tilt_state); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4002  __Pyx_GOTREF(__pyx_t_2);
4003  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4004  __Pyx_GOTREF(__pyx_t_1);
4005  __Pyx_INCREF(((PyObject *)__pyx_v_dev));
4006  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_dev));
4007  __Pyx_GIVEREF(((PyObject *)__pyx_v_dev));
4008  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4009  __Pyx_GOTREF(__pyx_t_4);
4010  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4011  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4012  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4013  __Pyx_GOTREF(__pyx_t_1);
4014  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
4015  __Pyx_GIVEREF(__pyx_t_4);
4016  __pyx_t_4 = 0;
4017  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4018  __Pyx_GOTREF(__pyx_t_4);
4019  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4020  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4021  __pyx_r = __pyx_t_4;
4022  __pyx_t_4 = 0;
4023  goto __pyx_L0;
4024 
4025  /* "freenect.pyx":281
4026  * return x, y, z
4027  *
4028  * def get_accel(DevPtr dev): # <<<<<<<<<<<<<<
4029  * """MKS Accelerometer helper
4030  *
4031  */
4032 
4033  /* function exit code */
4034  __pyx_L1_error:;
4035  __Pyx_XDECREF(__pyx_t_1);
4036  __Pyx_XDECREF(__pyx_t_2);
4037  __Pyx_XDECREF(__pyx_t_3);
4038  __Pyx_XDECREF(__pyx_t_4);
4039  __Pyx_AddTraceback("freenect.get_accel", __pyx_clineno, __pyx_lineno, __pyx_filename);
4040  __pyx_r = NULL;
4041  __pyx_L0:;
4042  __Pyx_XGIVEREF(__pyx_r);
4043  __Pyx_RefNannyFinishContext();
4044  return __pyx_r;
4045 }
4046 
4047 /* "freenect.pyx":294
4048  *
4049  *
4050  * def get_tilt_degs(StatePtr state): # <<<<<<<<<<<<<<
4051  * return freenect_get_tilt_degs(state._ptr)
4052  *
4053  */
4054 
4055 /* Python wrapper */
4056 static PyObject *__pyx_pw_8freenect_37get_tilt_degs(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/
4057 static PyMethodDef __pyx_mdef_8freenect_37get_tilt_degs = {__Pyx_NAMESTR("get_tilt_degs"), (PyCFunction)__pyx_pw_8freenect_37get_tilt_degs, METH_O, __Pyx_DOCSTR(0)};
4058 static PyObject *__pyx_pw_8freenect_37get_tilt_degs(PyObject *__pyx_self, PyObject *__pyx_v_state) {
4059  CYTHON_UNUSED int __pyx_lineno = 0;
4060  CYTHON_UNUSED const char *__pyx_filename = NULL;
4061  CYTHON_UNUSED int __pyx_clineno = 0;
4062  PyObject *__pyx_r = 0;
4063  __Pyx_RefNannyDeclarations
4064  __Pyx_RefNannySetupContext("get_tilt_degs (wrapper)", 0);
4065  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), __pyx_ptype_8freenect_StatePtr, 1, "state", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4066  __pyx_r = __pyx_pf_8freenect_36get_tilt_degs(__pyx_self, ((struct __pyx_obj_8freenect_StatePtr *)__pyx_v_state));
4067 
4068  /* function exit code */
4069  goto __pyx_L0;
4070  __pyx_L1_error:;
4071  __pyx_r = NULL;
4072  __pyx_L0:;
4073  __Pyx_RefNannyFinishContext();
4074  return __pyx_r;
4075 }
4076 
4077 static PyObject *__pyx_pf_8freenect_36get_tilt_degs(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_StatePtr *__pyx_v_state) {
4078  PyObject *__pyx_r = NULL;
4079  __Pyx_RefNannyDeclarations
4080  PyObject *__pyx_t_1 = NULL;
4081  int __pyx_lineno = 0;
4082  const char *__pyx_filename = NULL;
4083  int __pyx_clineno = 0;
4084  __Pyx_RefNannySetupContext("get_tilt_degs", 0);
4085 
4086  /* "freenect.pyx":295
4087  *
4088  * def get_tilt_degs(StatePtr state):
4089  * return freenect_get_tilt_degs(state._ptr) # <<<<<<<<<<<<<<
4090  *
4091  *
4092  */
4093  __Pyx_XDECREF(__pyx_r);
4094  __pyx_t_1 = PyFloat_FromDouble(freenect_get_tilt_degs(__pyx_v_state->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4095  __Pyx_GOTREF(__pyx_t_1);
4096  __pyx_r = __pyx_t_1;
4097  __pyx_t_1 = 0;
4098  goto __pyx_L0;
4099 
4100  /* "freenect.pyx":294
4101  *
4102  *
4103  * def get_tilt_degs(StatePtr state): # <<<<<<<<<<<<<<
4104  * return freenect_get_tilt_degs(state._ptr)
4105  *
4106  */
4107 
4108  /* function exit code */
4109  __pyx_L1_error:;
4110  __Pyx_XDECREF(__pyx_t_1);
4111  __Pyx_AddTraceback("freenect.get_tilt_degs", __pyx_clineno, __pyx_lineno, __pyx_filename);
4112  __pyx_r = NULL;
4113  __pyx_L0:;
4114  __Pyx_XGIVEREF(__pyx_r);
4115  __Pyx_RefNannyFinishContext();
4116  return __pyx_r;
4117 }
4118 
4119 /* "freenect.pyx":298
4120  *
4121  *
4122  * def error_open_device(): # <<<<<<<<<<<<<<
4123  * print("Error: Can't open device. 1.) is it plugged in? 2.) Read the README")
4124  *
4125  */
4126 
4127 /* Python wrapper */
4128 static PyObject *__pyx_pw_8freenect_39error_open_device(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4129 static PyMethodDef __pyx_mdef_8freenect_39error_open_device = {__Pyx_NAMESTR("error_open_device"), (PyCFunction)__pyx_pw_8freenect_39error_open_device, METH_NOARGS, __Pyx_DOCSTR(0)};
4130 static PyObject *__pyx_pw_8freenect_39error_open_device(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
4131  PyObject *__pyx_r = 0;
4132  __Pyx_RefNannyDeclarations
4133  __Pyx_RefNannySetupContext("error_open_device (wrapper)", 0);
4134  __pyx_r = __pyx_pf_8freenect_38error_open_device(__pyx_self);
4135 
4136  /* function exit code */
4137  __Pyx_RefNannyFinishContext();
4138  return __pyx_r;
4139 }
4140 
4141 static PyObject *__pyx_pf_8freenect_38error_open_device(CYTHON_UNUSED PyObject *__pyx_self) {
4142  PyObject *__pyx_r = NULL;
4143  __Pyx_RefNannyDeclarations
4144  int __pyx_lineno = 0;
4145  const char *__pyx_filename = NULL;
4146  int __pyx_clineno = 0;
4147  __Pyx_RefNannySetupContext("error_open_device", 0);
4148 
4149  /* "freenect.pyx":299
4150  *
4151  * def error_open_device():
4152  * print("Error: Can't open device. 1.) is it plugged in? 2.) Read the README") # <<<<<<<<<<<<<<
4153  *
4154  * cpdef init():
4155  */
4156  if (__Pyx_PrintOne(0, __pyx_kp_s_Error_Can_t_open_device_1_is_it) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4157 
4158  /* "freenect.pyx":298
4159  *
4160  *
4161  * def error_open_device(): # <<<<<<<<<<<<<<
4162  * print("Error: Can't open device. 1.) is it plugged in? 2.) Read the README")
4163  *
4164  */
4165 
4166  /* function exit code */
4167  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4168  goto __pyx_L0;
4169  __pyx_L1_error:;
4170  __Pyx_AddTraceback("freenect.error_open_device", __pyx_clineno, __pyx_lineno, __pyx_filename);
4171  __pyx_r = NULL;
4172  __pyx_L0:;
4173  __Pyx_XGIVEREF(__pyx_r);
4174  __Pyx_RefNannyFinishContext();
4175  return __pyx_r;
4176 }
4177 
4178 /* "freenect.pyx":301
4179  * print("Error: Can't open device. 1.) is it plugged in? 2.) Read the README")
4180  *
4181  * cpdef init(): # <<<<<<<<<<<<<<
4182  * cdef freenect_context* ctx
4183  * if freenect_init(&ctx, NULL) < 0:
4184  */
4185 
4186 static PyObject *__pyx_pw_8freenect_41init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4187 static PyObject *__pyx_f_8freenect_init(CYTHON_UNUSED int __pyx_skip_dispatch) {
4188  freenect_context *__pyx_v_ctx;
4189  struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx_out = 0;
4190  PyObject *__pyx_r = NULL;
4191  __Pyx_RefNannyDeclarations
4192  int __pyx_t_1;
4193  PyObject *__pyx_t_2 = NULL;
4194  int __pyx_lineno = 0;
4195  const char *__pyx_filename = NULL;
4196  int __pyx_clineno = 0;
4197  __Pyx_RefNannySetupContext("init", 0);
4198 
4199  /* "freenect.pyx":303
4200  * cpdef init():
4201  * cdef freenect_context* ctx
4202  * if freenect_init(&ctx, NULL) < 0: # <<<<<<<<<<<<<<
4203  * return
4204  * # We take both the motor and camera devices here, since we provide access
4205  */
4206  __pyx_t_1 = ((freenect_init((&__pyx_v_ctx), NULL) < 0) != 0);
4207  if (__pyx_t_1) {
4208 
4209  /* "freenect.pyx":304
4210  * cdef freenect_context* ctx
4211  * if freenect_init(&ctx, NULL) < 0:
4212  * return # <<<<<<<<<<<<<<
4213  * # We take both the motor and camera devices here, since we provide access
4214  * # to both but haven't wrapped the python API for selecting subdevices yet.
4215  */
4216  __Pyx_XDECREF(__pyx_r);
4217  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4218  goto __pyx_L0;
4219  }
4220 
4221  /* "freenect.pyx":309
4222  * # Also, we don't support audio in the python wrapper yet, so no sense claiming
4223  * # the device.
4224  * freenect_select_subdevices(ctx, <freenect_device_flags> (FREENECT_DEVICE_MOTOR | FREENECT_DEVICE_CAMERA)) # <<<<<<<<<<<<<<
4225  * cdef CtxPtr ctx_out = CtxPtr.__new__(CtxPtr)
4226  * ctx_out._ptr = ctx
4227  */
4229 
4230  /* "freenect.pyx":310
4231  * # the device.
4232  * freenect_select_subdevices(ctx, <freenect_device_flags> (FREENECT_DEVICE_MOTOR | FREENECT_DEVICE_CAMERA))
4233  * cdef CtxPtr ctx_out = CtxPtr.__new__(CtxPtr) # <<<<<<<<<<<<<<
4234  * ctx_out._ptr = ctx
4235  * return ctx_out
4236  */
4237  __pyx_t_2 = __pyx_tp_new_8freenect_CtxPtr(((PyTypeObject *)((PyObject*)__pyx_ptype_8freenect_CtxPtr)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4238  __Pyx_GOTREF(__pyx_t_2);
4239  if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8freenect_CtxPtr)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4240  __pyx_v_ctx_out = ((struct __pyx_obj_8freenect_CtxPtr *)__pyx_t_2);
4241  __pyx_t_2 = 0;
4242 
4243  /* "freenect.pyx":311
4244  * freenect_select_subdevices(ctx, <freenect_device_flags> (FREENECT_DEVICE_MOTOR | FREENECT_DEVICE_CAMERA))
4245  * cdef CtxPtr ctx_out = CtxPtr.__new__(CtxPtr)
4246  * ctx_out._ptr = ctx # <<<<<<<<<<<<<<
4247  * return ctx_out
4248  *
4249  */
4250  __pyx_v_ctx_out->_ptr = __pyx_v_ctx;
4251 
4252  /* "freenect.pyx":312
4253  * cdef CtxPtr ctx_out = CtxPtr.__new__(CtxPtr)
4254  * ctx_out._ptr = ctx
4255  * return ctx_out # <<<<<<<<<<<<<<
4256  *
4257  * cpdef open_device(CtxPtr ctx, int index):
4258  */
4259  __Pyx_XDECREF(__pyx_r);
4260  __Pyx_INCREF(((PyObject *)__pyx_v_ctx_out));
4261  __pyx_r = ((PyObject *)__pyx_v_ctx_out);
4262  goto __pyx_L0;
4263 
4264  /* "freenect.pyx":301
4265  * print("Error: Can't open device. 1.) is it plugged in? 2.) Read the README")
4266  *
4267  * cpdef init(): # <<<<<<<<<<<<<<
4268  * cdef freenect_context* ctx
4269  * if freenect_init(&ctx, NULL) < 0:
4270  */
4271 
4272  /* function exit code */
4273  __pyx_L1_error:;
4274  __Pyx_XDECREF(__pyx_t_2);
4275  __Pyx_AddTraceback("freenect.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
4276  __pyx_r = 0;
4277  __pyx_L0:;
4278  __Pyx_XDECREF((PyObject *)__pyx_v_ctx_out);
4279  __Pyx_XGIVEREF(__pyx_r);
4280  __Pyx_RefNannyFinishContext();
4281  return __pyx_r;
4282 }
4283 
4284 /* Python wrapper */
4285 static PyObject *__pyx_pw_8freenect_41init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4286 static PyObject *__pyx_pw_8freenect_41init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
4287  PyObject *__pyx_r = 0;
4288  __Pyx_RefNannyDeclarations
4289  __Pyx_RefNannySetupContext("init (wrapper)", 0);
4290  __pyx_r = __pyx_pf_8freenect_40init(__pyx_self);
4291 
4292  /* function exit code */
4293  __Pyx_RefNannyFinishContext();
4294  return __pyx_r;
4295 }
4296 
4297 static PyObject *__pyx_pf_8freenect_40init(CYTHON_UNUSED PyObject *__pyx_self) {
4298  PyObject *__pyx_r = NULL;
4299  __Pyx_RefNannyDeclarations
4300  PyObject *__pyx_t_1 = NULL;
4301  int __pyx_lineno = 0;
4302  const char *__pyx_filename = NULL;
4303  int __pyx_clineno = 0;
4304  __Pyx_RefNannySetupContext("init", 0);
4305  __Pyx_XDECREF(__pyx_r);
4306  __pyx_t_1 = __pyx_f_8freenect_init(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4307  __Pyx_GOTREF(__pyx_t_1);
4308  __pyx_r = __pyx_t_1;
4309  __pyx_t_1 = 0;
4310  goto __pyx_L0;
4311 
4312  /* function exit code */
4313  __pyx_L1_error:;
4314  __Pyx_XDECREF(__pyx_t_1);
4315  __Pyx_AddTraceback("freenect.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
4316  __pyx_r = NULL;
4317  __pyx_L0:;
4318  __Pyx_XGIVEREF(__pyx_r);
4319  __Pyx_RefNannyFinishContext();
4320  return __pyx_r;
4321 }
4322 
4323 /* "freenect.pyx":314
4324  * return ctx_out
4325  *
4326  * cpdef open_device(CtxPtr ctx, int index): # <<<<<<<<<<<<<<
4327  * cdef freenect_device* dev
4328  * if freenect_open_device(ctx._ptr, &dev, index) < 0:
4329  */
4330 
4331 static PyObject *__pyx_pw_8freenect_43open_device(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4332 static PyObject *__pyx_f_8freenect_open_device(struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx, int __pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) {
4333  freenect_device *__pyx_v_dev;
4334  struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev_out = 0;
4335  PyObject *__pyx_r = NULL;
4336  __Pyx_RefNannyDeclarations
4337  int __pyx_t_1;
4338  PyObject *__pyx_t_2 = NULL;
4339  int __pyx_lineno = 0;
4340  const char *__pyx_filename = NULL;
4341  int __pyx_clineno = 0;
4342  __Pyx_RefNannySetupContext("open_device", 0);
4343 
4344  /* "freenect.pyx":316
4345  * cpdef open_device(CtxPtr ctx, int index):
4346  * cdef freenect_device* dev
4347  * if freenect_open_device(ctx._ptr, &dev, index) < 0: # <<<<<<<<<<<<<<
4348  * return
4349  * cdef DevPtr dev_out = DevPtr.__new__(DevPtr)
4350  */
4351  __pyx_t_1 = ((freenect_open_device(__pyx_v_ctx->_ptr, (&__pyx_v_dev), __pyx_v_index) < 0) != 0);
4352  if (__pyx_t_1) {
4353 
4354  /* "freenect.pyx":317
4355  * cdef freenect_device* dev
4356  * if freenect_open_device(ctx._ptr, &dev, index) < 0:
4357  * return # <<<<<<<<<<<<<<
4358  * cdef DevPtr dev_out = DevPtr.__new__(DevPtr)
4359  * dev_out._ptr = dev
4360  */
4361  __Pyx_XDECREF(__pyx_r);
4362  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4363  goto __pyx_L0;
4364  }
4365 
4366  /* "freenect.pyx":318
4367  * if freenect_open_device(ctx._ptr, &dev, index) < 0:
4368  * return
4369  * cdef DevPtr dev_out = DevPtr.__new__(DevPtr) # <<<<<<<<<<<<<<
4370  * dev_out._ptr = dev
4371  * dev_out.ctx = ctx
4372  */
4373  __pyx_t_2 = __pyx_tp_new_8freenect_DevPtr(((PyTypeObject *)((PyObject*)__pyx_ptype_8freenect_DevPtr)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4374  __Pyx_GOTREF(__pyx_t_2);
4375  if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8freenect_DevPtr)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4376  __pyx_v_dev_out = ((struct __pyx_obj_8freenect_DevPtr *)__pyx_t_2);
4377  __pyx_t_2 = 0;
4378 
4379  /* "freenect.pyx":319
4380  * return
4381  * cdef DevPtr dev_out = DevPtr.__new__(DevPtr)
4382  * dev_out._ptr = dev # <<<<<<<<<<<<<<
4383  * dev_out.ctx = ctx
4384  * return dev_out
4385  */
4386  __pyx_v_dev_out->_ptr = __pyx_v_dev;
4387 
4388  /* "freenect.pyx":320
4389  * cdef DevPtr dev_out = DevPtr.__new__(DevPtr)
4390  * dev_out._ptr = dev
4391  * dev_out.ctx = ctx # <<<<<<<<<<<<<<
4392  * return dev_out
4393  *
4394  */
4395  __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
4396  __Pyx_GIVEREF(((PyObject *)__pyx_v_ctx));
4397  __Pyx_GOTREF(__pyx_v_dev_out->ctx);
4398  __Pyx_DECREF(((PyObject *)__pyx_v_dev_out->ctx));
4399  __pyx_v_dev_out->ctx = __pyx_v_ctx;
4400 
4401  /* "freenect.pyx":321
4402  * dev_out._ptr = dev
4403  * dev_out.ctx = ctx
4404  * return dev_out # <<<<<<<<<<<<<<
4405  *
4406  * _depth_cb, _video_cb = None, None
4407  */
4408  __Pyx_XDECREF(__pyx_r);
4409  __Pyx_INCREF(((PyObject *)__pyx_v_dev_out));
4410  __pyx_r = ((PyObject *)__pyx_v_dev_out);
4411  goto __pyx_L0;
4412 
4413  /* "freenect.pyx":314
4414  * return ctx_out
4415  *
4416  * cpdef open_device(CtxPtr ctx, int index): # <<<<<<<<<<<<<<
4417  * cdef freenect_device* dev
4418  * if freenect_open_device(ctx._ptr, &dev, index) < 0:
4419  */
4420 
4421  /* function exit code */
4422  __pyx_L1_error:;
4423  __Pyx_XDECREF(__pyx_t_2);
4424  __Pyx_AddTraceback("freenect.open_device", __pyx_clineno, __pyx_lineno, __pyx_filename);
4425  __pyx_r = 0;
4426  __pyx_L0:;
4427  __Pyx_XDECREF((PyObject *)__pyx_v_dev_out);
4428  __Pyx_XGIVEREF(__pyx_r);
4429  __Pyx_RefNannyFinishContext();
4430  return __pyx_r;
4431 }
4432 
4433 /* Python wrapper */
4434 static PyObject *__pyx_pw_8freenect_43open_device(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4435 static PyObject *__pyx_pw_8freenect_43open_device(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4436  struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx = 0;
4437  int __pyx_v_index;
4438  int __pyx_lineno = 0;
4439  const char *__pyx_filename = NULL;
4440  int __pyx_clineno = 0;
4441  PyObject *__pyx_r = 0;
4442  __Pyx_RefNannyDeclarations
4443  __Pyx_RefNannySetupContext("open_device (wrapper)", 0);
4444  {
4445  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctx,&__pyx_n_s_index,0};
4446  PyObject* values[2] = {0,0};
4447  if (unlikely(__pyx_kwds)) {
4448  Py_ssize_t kw_args;
4449  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4450  switch (pos_args) {
4451  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4452  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4453  case 0: break;
4454  default: goto __pyx_L5_argtuple_error;
4455  }
4456  kw_args = PyDict_Size(__pyx_kwds);
4457  switch (pos_args) {
4458  case 0:
4459  if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ctx)) != 0)) kw_args--;
4460  else goto __pyx_L5_argtuple_error;
4461  case 1:
4462  if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
4463  else {
4464  __Pyx_RaiseArgtupleInvalid("open_device", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4465  }
4466  }
4467  if (unlikely(kw_args > 0)) {
4468  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "open_device") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4469  }
4470  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4471  goto __pyx_L5_argtuple_error;
4472  } else {
4473  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4474  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4475  }
4476  __pyx_v_ctx = ((struct __pyx_obj_8freenect_CtxPtr *)values[0]);
4477  __pyx_v_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4478  }
4479  goto __pyx_L4_argument_unpacking_done;
4480  __pyx_L5_argtuple_error:;
4481  __Pyx_RaiseArgtupleInvalid("open_device", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4482  __pyx_L3_error:;
4483  __Pyx_AddTraceback("freenect.open_device", __pyx_clineno, __pyx_lineno, __pyx_filename);
4484  __Pyx_RefNannyFinishContext();
4485  return NULL;
4486  __pyx_L4_argument_unpacking_done:;
4487  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_8freenect_CtxPtr, 1, "ctx", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4488  __pyx_r = __pyx_pf_8freenect_42open_device(__pyx_self, __pyx_v_ctx, __pyx_v_index);
4489 
4490  /* function exit code */
4491  goto __pyx_L0;
4492  __pyx_L1_error:;
4493  __pyx_r = NULL;
4494  __pyx_L0:;
4495  __Pyx_RefNannyFinishContext();
4496  return __pyx_r;
4497 }
4498 
4499 static PyObject *__pyx_pf_8freenect_42open_device(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx, int __pyx_v_index) {
4500  PyObject *__pyx_r = NULL;
4501  __Pyx_RefNannyDeclarations
4502  PyObject *__pyx_t_1 = NULL;
4503  int __pyx_lineno = 0;
4504  const char *__pyx_filename = NULL;
4505  int __pyx_clineno = 0;
4506  __Pyx_RefNannySetupContext("open_device", 0);
4507  __Pyx_XDECREF(__pyx_r);
4508  __pyx_t_1 = __pyx_f_8freenect_open_device(__pyx_v_ctx, __pyx_v_index, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4509  __Pyx_GOTREF(__pyx_t_1);
4510  __pyx_r = __pyx_t_1;
4511  __pyx_t_1 = 0;
4512  goto __pyx_L0;
4513 
4514  /* function exit code */
4515  __pyx_L1_error:;
4516  __Pyx_XDECREF(__pyx_t_1);
4517  __Pyx_AddTraceback("freenect.open_device", __pyx_clineno, __pyx_lineno, __pyx_filename);
4518  __pyx_r = NULL;
4519  __pyx_L0:;
4520  __Pyx_XGIVEREF(__pyx_r);
4521  __Pyx_RefNannyFinishContext();
4522  return __pyx_r;
4523 }
4524 
4525 /* "freenect.pyx":325
4526  * _depth_cb, _video_cb = None, None
4527  *
4528  * cdef void depth_cb(freenect_device *dev, void *data, uint32_t timestamp) with gil: # <<<<<<<<<<<<<<
4529  * cdef freenect_frame_mode mode = freenect_get_current_depth_mode(dev)
4530  * if not mode.is_valid:
4531  */
4532 
4533 static void __pyx_f_8freenect_depth_cb(freenect_device *__pyx_v_dev, void *__pyx_v_data, uint32_t __pyx_v_timestamp) {
4534  freenect_frame_mode __pyx_v_mode;
4535  struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev_out = 0;
4536  PyObject *__pyx_v_pydata = NULL;
4537  __Pyx_RefNannyDeclarations
4538  int __pyx_t_1;
4539  PyObject *__pyx_t_2 = NULL;
4540  int __pyx_t_3;
4541  PyObject *__pyx_t_4 = NULL;
4542  PyObject *__pyx_t_5 = NULL;
4543  int __pyx_lineno = 0;
4544  const char *__pyx_filename = NULL;
4545  int __pyx_clineno = 0;
4546  #ifdef WITH_THREAD
4547  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
4548  #endif
4549  __Pyx_RefNannySetupContext("depth_cb", 0);
4550 
4551  /* "freenect.pyx":326
4552  *
4553  * cdef void depth_cb(freenect_device *dev, void *data, uint32_t timestamp) with gil:
4554  * cdef freenect_frame_mode mode = freenect_get_current_depth_mode(dev) # <<<<<<<<<<<<<<
4555  * if not mode.is_valid:
4556  * return
4557  */
4558  __pyx_v_mode = freenect_get_current_depth_mode(__pyx_v_dev);
4559 
4560  /* "freenect.pyx":327
4561  * cdef void depth_cb(freenect_device *dev, void *data, uint32_t timestamp) with gil:
4562  * cdef freenect_frame_mode mode = freenect_get_current_depth_mode(dev)
4563  * if not mode.is_valid: # <<<<<<<<<<<<<<
4564  * return
4565  * if not _depth_cb:
4566  */
4567  __pyx_t_1 = ((!(__pyx_v_mode.is_valid != 0)) != 0);
4568  if (__pyx_t_1) {
4569 
4570  /* "freenect.pyx":328
4571  * cdef freenect_frame_mode mode = freenect_get_current_depth_mode(dev)
4572  * if not mode.is_valid:
4573  * return # <<<<<<<<<<<<<<
4574  * if not _depth_cb:
4575  * return
4576  */
4577  goto __pyx_L0;
4578  }
4579 
4580  /* "freenect.pyx":329
4581  * if not mode.is_valid:
4582  * return
4583  * if not _depth_cb: # <<<<<<<<<<<<<<
4584  * return
4585  * cdef DevPtr dev_out = DevPtr.__new__(DevPtr)
4586  */
4587  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_depth_cb); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4588  __Pyx_GOTREF(__pyx_t_2);
4589  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4590  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4591  __pyx_t_3 = ((!__pyx_t_1) != 0);
4592  if (__pyx_t_3) {
4593 
4594  /* "freenect.pyx":330
4595  * return
4596  * if not _depth_cb:
4597  * return # <<<<<<<<<<<<<<
4598  * cdef DevPtr dev_out = DevPtr.__new__(DevPtr)
4599  * dev_out._ptr = dev
4600  */
4601  goto __pyx_L0;
4602  }
4603 
4604  /* "freenect.pyx":331
4605  * if not _depth_cb:
4606  * return
4607  * cdef DevPtr dev_out = DevPtr.__new__(DevPtr) # <<<<<<<<<<<<<<
4608  * dev_out._ptr = dev
4609  * pydata = _depth_cb_np(data, &mode)
4610  */
4611  __pyx_t_2 = __pyx_tp_new_8freenect_DevPtr(((PyTypeObject *)((PyObject*)__pyx_ptype_8freenect_DevPtr)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4612  __Pyx_GOTREF(__pyx_t_2);
4613  if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8freenect_DevPtr)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4614  __pyx_v_dev_out = ((struct __pyx_obj_8freenect_DevPtr *)__pyx_t_2);
4615  __pyx_t_2 = 0;
4616 
4617  /* "freenect.pyx":332
4618  * return
4619  * cdef DevPtr dev_out = DevPtr.__new__(DevPtr)
4620  * dev_out._ptr = dev # <<<<<<<<<<<<<<
4621  * pydata = _depth_cb_np(data, &mode)
4622  * _depth_cb(dev_out, pydata, timestamp)
4623  */
4624  __pyx_v_dev_out->_ptr = __pyx_v_dev;
4625 
4626  /* "freenect.pyx":333
4627  * cdef DevPtr dev_out = DevPtr.__new__(DevPtr)
4628  * dev_out._ptr = dev
4629  * pydata = _depth_cb_np(data, &mode) # <<<<<<<<<<<<<<
4630  * _depth_cb(dev_out, pydata, timestamp)
4631  *
4632  */
4633  __pyx_t_2 = __pyx_f_8freenect__depth_cb_np(__pyx_v_data, (&__pyx_v_mode)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4634  __Pyx_GOTREF(__pyx_t_2);
4635  __pyx_v_pydata = __pyx_t_2;
4636  __pyx_t_2 = 0;
4637 
4638  /* "freenect.pyx":334
4639  * dev_out._ptr = dev
4640  * pydata = _depth_cb_np(data, &mode)
4641  * _depth_cb(dev_out, pydata, timestamp) # <<<<<<<<<<<<<<
4642  *
4643  * cdef void video_cb(freenect_device *dev, void *data, uint32_t timestamp) with gil:
4644  */
4645  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_depth_cb); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4646  __Pyx_GOTREF(__pyx_t_2);
4647  __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_timestamp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4648  __Pyx_GOTREF(__pyx_t_4);
4649  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4650  __Pyx_GOTREF(__pyx_t_5);
4651  __Pyx_INCREF(((PyObject *)__pyx_v_dev_out));
4652  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_dev_out));
4653  __Pyx_GIVEREF(((PyObject *)__pyx_v_dev_out));
4654  __Pyx_INCREF(__pyx_v_pydata);
4655  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_pydata);
4656  __Pyx_GIVEREF(__pyx_v_pydata);
4657  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
4658  __Pyx_GIVEREF(__pyx_t_4);
4659  __pyx_t_4 = 0;
4660  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4661  __Pyx_GOTREF(__pyx_t_4);
4662  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4663  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4664  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4665 
4666  /* "freenect.pyx":325
4667  * _depth_cb, _video_cb = None, None
4668  *
4669  * cdef void depth_cb(freenect_device *dev, void *data, uint32_t timestamp) with gil: # <<<<<<<<<<<<<<
4670  * cdef freenect_frame_mode mode = freenect_get_current_depth_mode(dev)
4671  * if not mode.is_valid:
4672  */
4673 
4674  /* function exit code */
4675  goto __pyx_L0;
4676  __pyx_L1_error:;
4677  __Pyx_XDECREF(__pyx_t_2);
4678  __Pyx_XDECREF(__pyx_t_4);
4679  __Pyx_XDECREF(__pyx_t_5);
4680  __Pyx_WriteUnraisable("freenect.depth_cb", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
4681  __pyx_L0:;
4682  __Pyx_XDECREF((PyObject *)__pyx_v_dev_out);
4683  __Pyx_XDECREF(__pyx_v_pydata);
4684  __Pyx_RefNannyFinishContext();
4685  #ifdef WITH_THREAD
4686  PyGILState_Release(__pyx_gilstate_save);
4687  #endif
4688 }
4689 
4690 /* "freenect.pyx":336
4691  * _depth_cb(dev_out, pydata, timestamp)
4692  *
4693  * cdef void video_cb(freenect_device *dev, void *data, uint32_t timestamp) with gil: # <<<<<<<<<<<<<<
4694  * cdef freenect_frame_mode mode = freenect_get_current_video_mode(dev)
4695  * if not mode.is_valid:
4696  */
4697 
4698 static void __pyx_f_8freenect_video_cb(freenect_device *__pyx_v_dev, void *__pyx_v_data, uint32_t __pyx_v_timestamp) {
4699  freenect_frame_mode __pyx_v_mode;
4700  struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev_out = 0;
4701  PyObject *__pyx_v_pydata = NULL;
4702  __Pyx_RefNannyDeclarations
4703  int __pyx_t_1;
4704  PyObject *__pyx_t_2 = NULL;
4705  int __pyx_t_3;
4706  PyObject *__pyx_t_4 = NULL;
4707  PyObject *__pyx_t_5 = NULL;
4708  int __pyx_lineno = 0;
4709  const char *__pyx_filename = NULL;
4710  int __pyx_clineno = 0;
4711  #ifdef WITH_THREAD
4712  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
4713  #endif
4714  __Pyx_RefNannySetupContext("video_cb", 0);
4715 
4716  /* "freenect.pyx":337
4717  *
4718  * cdef void video_cb(freenect_device *dev, void *data, uint32_t timestamp) with gil:
4719  * cdef freenect_frame_mode mode = freenect_get_current_video_mode(dev) # <<<<<<<<<<<<<<
4720  * if not mode.is_valid:
4721  * return
4722  */
4723  __pyx_v_mode = freenect_get_current_video_mode(__pyx_v_dev);
4724 
4725  /* "freenect.pyx":338
4726  * cdef void video_cb(freenect_device *dev, void *data, uint32_t timestamp) with gil:
4727  * cdef freenect_frame_mode mode = freenect_get_current_video_mode(dev)
4728  * if not mode.is_valid: # <<<<<<<<<<<<<<
4729  * return
4730  * if not _video_cb:
4731  */
4732  __pyx_t_1 = ((!(__pyx_v_mode.is_valid != 0)) != 0);
4733  if (__pyx_t_1) {
4734 
4735  /* "freenect.pyx":339
4736  * cdef freenect_frame_mode mode = freenect_get_current_video_mode(dev)
4737  * if not mode.is_valid:
4738  * return # <<<<<<<<<<<<<<
4739  * if not _video_cb:
4740  * return
4741  */
4742  goto __pyx_L0;
4743  }
4744 
4745  /* "freenect.pyx":340
4746  * if not mode.is_valid:
4747  * return
4748  * if not _video_cb: # <<<<<<<<<<<<<<
4749  * return
4750  * cdef DevPtr dev_out = DevPtr.__new__(DevPtr)
4751  */
4752  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_video_cb); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4753  __Pyx_GOTREF(__pyx_t_2);
4754  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4755  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4756  __pyx_t_3 = ((!__pyx_t_1) != 0);
4757  if (__pyx_t_3) {
4758 
4759  /* "freenect.pyx":341
4760  * return
4761  * if not _video_cb:
4762  * return # <<<<<<<<<<<<<<
4763  * cdef DevPtr dev_out = DevPtr.__new__(DevPtr)
4764  * dev_out._ptr = dev
4765  */
4766  goto __pyx_L0;
4767  }
4768 
4769  /* "freenect.pyx":342
4770  * if not _video_cb:
4771  * return
4772  * cdef DevPtr dev_out = DevPtr.__new__(DevPtr) # <<<<<<<<<<<<<<
4773  * dev_out._ptr = dev
4774  * pydata = _video_cb_np(data, &mode)
4775  */
4776  __pyx_t_2 = __pyx_tp_new_8freenect_DevPtr(((PyTypeObject *)((PyObject*)__pyx_ptype_8freenect_DevPtr)), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4777  __Pyx_GOTREF(__pyx_t_2);
4778  if (!(likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8freenect_DevPtr)))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4779  __pyx_v_dev_out = ((struct __pyx_obj_8freenect_DevPtr *)__pyx_t_2);
4780  __pyx_t_2 = 0;
4781 
4782  /* "freenect.pyx":343
4783  * return
4784  * cdef DevPtr dev_out = DevPtr.__new__(DevPtr)
4785  * dev_out._ptr = dev # <<<<<<<<<<<<<<
4786  * pydata = _video_cb_np(data, &mode)
4787  * _video_cb(dev_out, pydata, timestamp)
4788  */
4789  __pyx_v_dev_out->_ptr = __pyx_v_dev;
4790 
4791  /* "freenect.pyx":344
4792  * cdef DevPtr dev_out = DevPtr.__new__(DevPtr)
4793  * dev_out._ptr = dev
4794  * pydata = _video_cb_np(data, &mode) # <<<<<<<<<<<<<<
4795  * _video_cb(dev_out, pydata, timestamp)
4796  *
4797  */
4798  __pyx_t_2 = __pyx_f_8freenect__video_cb_np(__pyx_v_data, (&__pyx_v_mode)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4799  __Pyx_GOTREF(__pyx_t_2);
4800  __pyx_v_pydata = __pyx_t_2;
4801  __pyx_t_2 = 0;
4802 
4803  /* "freenect.pyx":345
4804  * dev_out._ptr = dev
4805  * pydata = _video_cb_np(data, &mode)
4806  * _video_cb(dev_out, pydata, timestamp) # <<<<<<<<<<<<<<
4807  *
4808  * def set_depth_callback(DevPtr dev, cb):
4809  */
4810  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_video_cb); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4811  __Pyx_GOTREF(__pyx_t_2);
4812  __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_timestamp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4813  __Pyx_GOTREF(__pyx_t_4);
4814  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4815  __Pyx_GOTREF(__pyx_t_5);
4816  __Pyx_INCREF(((PyObject *)__pyx_v_dev_out));
4817  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_dev_out));
4818  __Pyx_GIVEREF(((PyObject *)__pyx_v_dev_out));
4819  __Pyx_INCREF(__pyx_v_pydata);
4820  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_pydata);
4821  __Pyx_GIVEREF(__pyx_v_pydata);
4822  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
4823  __Pyx_GIVEREF(__pyx_t_4);
4824  __pyx_t_4 = 0;
4825  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4826  __Pyx_GOTREF(__pyx_t_4);
4827  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4828  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4829  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4830 
4831  /* "freenect.pyx":336
4832  * _depth_cb(dev_out, pydata, timestamp)
4833  *
4834  * cdef void video_cb(freenect_device *dev, void *data, uint32_t timestamp) with gil: # <<<<<<<<<<<<<<
4835  * cdef freenect_frame_mode mode = freenect_get_current_video_mode(dev)
4836  * if not mode.is_valid:
4837  */
4838 
4839  /* function exit code */
4840  goto __pyx_L0;
4841  __pyx_L1_error:;
4842  __Pyx_XDECREF(__pyx_t_2);
4843  __Pyx_XDECREF(__pyx_t_4);
4844  __Pyx_XDECREF(__pyx_t_5);
4845  __Pyx_WriteUnraisable("freenect.video_cb", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
4846  __pyx_L0:;
4847  __Pyx_XDECREF((PyObject *)__pyx_v_dev_out);
4848  __Pyx_XDECREF(__pyx_v_pydata);
4849  __Pyx_RefNannyFinishContext();
4850  #ifdef WITH_THREAD
4851  PyGILState_Release(__pyx_gilstate_save);
4852  #endif
4853 }
4854 
4855 /* "freenect.pyx":347
4856  * _video_cb(dev_out, pydata, timestamp)
4857  *
4858  * def set_depth_callback(DevPtr dev, cb): # <<<<<<<<<<<<<<
4859  * global _depth_cb
4860  * if cb is not None:
4861  */
4862 
4863 /* Python wrapper */
4864 static PyObject *__pyx_pw_8freenect_45set_depth_callback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4865 static PyMethodDef __pyx_mdef_8freenect_45set_depth_callback = {__Pyx_NAMESTR("set_depth_callback"), (PyCFunction)__pyx_pw_8freenect_45set_depth_callback, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
4866 static PyObject *__pyx_pw_8freenect_45set_depth_callback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4867  struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev = 0;
4868  PyObject *__pyx_v_cb = 0;
4869  int __pyx_lineno = 0;
4870  const char *__pyx_filename = NULL;
4871  int __pyx_clineno = 0;
4872  PyObject *__pyx_r = 0;
4873  __Pyx_RefNannyDeclarations
4874  __Pyx_RefNannySetupContext("set_depth_callback (wrapper)", 0);
4875  {
4876  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dev,&__pyx_n_s_cb,0};
4877  PyObject* values[2] = {0,0};
4878  if (unlikely(__pyx_kwds)) {
4879  Py_ssize_t kw_args;
4880  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4881  switch (pos_args) {
4882  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4883  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4884  case 0: break;
4885  default: goto __pyx_L5_argtuple_error;
4886  }
4887  kw_args = PyDict_Size(__pyx_kwds);
4888  switch (pos_args) {
4889  case 0:
4890  if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev)) != 0)) kw_args--;
4891  else goto __pyx_L5_argtuple_error;
4892  case 1:
4893  if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cb)) != 0)) kw_args--;
4894  else {
4895  __Pyx_RaiseArgtupleInvalid("set_depth_callback", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4896  }
4897  }
4898  if (unlikely(kw_args > 0)) {
4899  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_depth_callback") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4900  }
4901  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4902  goto __pyx_L5_argtuple_error;
4903  } else {
4904  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4905  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4906  }
4907  __pyx_v_dev = ((struct __pyx_obj_8freenect_DevPtr *)values[0]);
4908  __pyx_v_cb = values[1];
4909  }
4910  goto __pyx_L4_argument_unpacking_done;
4911  __pyx_L5_argtuple_error:;
4912  __Pyx_RaiseArgtupleInvalid("set_depth_callback", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4913  __pyx_L3_error:;
4914  __Pyx_AddTraceback("freenect.set_depth_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
4915  __Pyx_RefNannyFinishContext();
4916  return NULL;
4917  __pyx_L4_argument_unpacking_done:;
4918  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4919  __pyx_r = __pyx_pf_8freenect_44set_depth_callback(__pyx_self, __pyx_v_dev, __pyx_v_cb);
4920 
4921  /* function exit code */
4922  goto __pyx_L0;
4923  __pyx_L1_error:;
4924  __pyx_r = NULL;
4925  __pyx_L0:;
4926  __Pyx_RefNannyFinishContext();
4927  return __pyx_r;
4928 }
4929 
4930 static PyObject *__pyx_pf_8freenect_44set_depth_callback(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev, PyObject *__pyx_v_cb) {
4931  PyObject *__pyx_r = NULL;
4932  __Pyx_RefNannyDeclarations
4933  int __pyx_t_1;
4934  int __pyx_t_2;
4935  int __pyx_lineno = 0;
4936  const char *__pyx_filename = NULL;
4937  int __pyx_clineno = 0;
4938  __Pyx_RefNannySetupContext("set_depth_callback", 0);
4939 
4940  /* "freenect.pyx":349
4941  * def set_depth_callback(DevPtr dev, cb):
4942  * global _depth_cb
4943  * if cb is not None: # <<<<<<<<<<<<<<
4944  * _depth_cb = cb
4945  * freenect_set_depth_callback(dev._ptr, depth_cb)
4946  */
4947  __pyx_t_1 = (__pyx_v_cb != Py_None);
4948  __pyx_t_2 = (__pyx_t_1 != 0);
4949  if (__pyx_t_2) {
4950 
4951  /* "freenect.pyx":350
4952  * global _depth_cb
4953  * if cb is not None:
4954  * _depth_cb = cb # <<<<<<<<<<<<<<
4955  * freenect_set_depth_callback(dev._ptr, depth_cb)
4956  * else:
4957  */
4958  if (PyDict_SetItem(__pyx_d, __pyx_n_s_depth_cb, __pyx_v_cb) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4959 
4960  /* "freenect.pyx":351
4961  * if cb is not None:
4962  * _depth_cb = cb
4963  * freenect_set_depth_callback(dev._ptr, depth_cb) # <<<<<<<<<<<<<<
4964  * else:
4965  * _depth_cb = None
4966  */
4967  freenect_set_depth_callback(__pyx_v_dev->_ptr, __pyx_f_8freenect_depth_cb);
4968  goto __pyx_L3;
4969  }
4970  /*else*/ {
4971 
4972  /* "freenect.pyx":353
4973  * freenect_set_depth_callback(dev._ptr, depth_cb)
4974  * else:
4975  * _depth_cb = None # <<<<<<<<<<<<<<
4976  * freenect_set_depth_callback(dev._ptr, NULL)
4977  *
4978  */
4979  if (PyDict_SetItem(__pyx_d, __pyx_n_s_depth_cb, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4980 
4981  /* "freenect.pyx":354
4982  * else:
4983  * _depth_cb = None
4984  * freenect_set_depth_callback(dev._ptr, NULL) # <<<<<<<<<<<<<<
4985  *
4986  * def set_video_callback(DevPtr dev, cb):
4987  */
4988  freenect_set_depth_callback(__pyx_v_dev->_ptr, NULL);
4989  }
4990  __pyx_L3:;
4991 
4992  /* "freenect.pyx":347
4993  * _video_cb(dev_out, pydata, timestamp)
4994  *
4995  * def set_depth_callback(DevPtr dev, cb): # <<<<<<<<<<<<<<
4996  * global _depth_cb
4997  * if cb is not None:
4998  */
4999 
5000  /* function exit code */
5001  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5002  goto __pyx_L0;
5003  __pyx_L1_error:;
5004  __Pyx_AddTraceback("freenect.set_depth_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
5005  __pyx_r = NULL;
5006  __pyx_L0:;
5007  __Pyx_XGIVEREF(__pyx_r);
5008  __Pyx_RefNannyFinishContext();
5009  return __pyx_r;
5010 }
5011 
5012 /* "freenect.pyx":356
5013  * freenect_set_depth_callback(dev._ptr, NULL)
5014  *
5015  * def set_video_callback(DevPtr dev, cb): # <<<<<<<<<<<<<<
5016  * global _video_cb
5017  * if cb is not None:
5018  */
5019 
5020 /* Python wrapper */
5021 static PyObject *__pyx_pw_8freenect_47set_video_callback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5022 static PyMethodDef __pyx_mdef_8freenect_47set_video_callback = {__Pyx_NAMESTR("set_video_callback"), (PyCFunction)__pyx_pw_8freenect_47set_video_callback, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
5023 static PyObject *__pyx_pw_8freenect_47set_video_callback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5024  struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev = 0;
5025  PyObject *__pyx_v_cb = 0;
5026  int __pyx_lineno = 0;
5027  const char *__pyx_filename = NULL;
5028  int __pyx_clineno = 0;
5029  PyObject *__pyx_r = 0;
5030  __Pyx_RefNannyDeclarations
5031  __Pyx_RefNannySetupContext("set_video_callback (wrapper)", 0);
5032  {
5033  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dev,&__pyx_n_s_cb,0};
5034  PyObject* values[2] = {0,0};
5035  if (unlikely(__pyx_kwds)) {
5036  Py_ssize_t kw_args;
5037  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5038  switch (pos_args) {
5039  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5040  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5041  case 0: break;
5042  default: goto __pyx_L5_argtuple_error;
5043  }
5044  kw_args = PyDict_Size(__pyx_kwds);
5045  switch (pos_args) {
5046  case 0:
5047  if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev)) != 0)) kw_args--;
5048  else goto __pyx_L5_argtuple_error;
5049  case 1:
5050  if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cb)) != 0)) kw_args--;
5051  else {
5052  __Pyx_RaiseArgtupleInvalid("set_video_callback", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5053  }
5054  }
5055  if (unlikely(kw_args > 0)) {
5056  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_video_callback") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5057  }
5058  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5059  goto __pyx_L5_argtuple_error;
5060  } else {
5061  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5062  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5063  }
5064  __pyx_v_dev = ((struct __pyx_obj_8freenect_DevPtr *)values[0]);
5065  __pyx_v_cb = values[1];
5066  }
5067  goto __pyx_L4_argument_unpacking_done;
5068  __pyx_L5_argtuple_error:;
5069  __Pyx_RaiseArgtupleInvalid("set_video_callback", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5070  __pyx_L3_error:;
5071  __Pyx_AddTraceback("freenect.set_video_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
5072  __Pyx_RefNannyFinishContext();
5073  return NULL;
5074  __pyx_L4_argument_unpacking_done:;
5075  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dev), __pyx_ptype_8freenect_DevPtr, 1, "dev", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5076  __pyx_r = __pyx_pf_8freenect_46set_video_callback(__pyx_self, __pyx_v_dev, __pyx_v_cb);
5077 
5078  /* function exit code */
5079  goto __pyx_L0;
5080  __pyx_L1_error:;
5081  __pyx_r = NULL;
5082  __pyx_L0:;
5083  __Pyx_RefNannyFinishContext();
5084  return __pyx_r;
5085 }
5086 
5087 static PyObject *__pyx_pf_8freenect_46set_video_callback(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev, PyObject *__pyx_v_cb) {
5088  PyObject *__pyx_r = NULL;
5089  __Pyx_RefNannyDeclarations
5090  int __pyx_t_1;
5091  int __pyx_t_2;
5092  int __pyx_lineno = 0;
5093  const char *__pyx_filename = NULL;
5094  int __pyx_clineno = 0;
5095  __Pyx_RefNannySetupContext("set_video_callback", 0);
5096 
5097  /* "freenect.pyx":358
5098  * def set_video_callback(DevPtr dev, cb):
5099  * global _video_cb
5100  * if cb is not None: # <<<<<<<<<<<<<<
5101  * _video_cb = cb
5102  * freenect_set_video_callback(dev._ptr, video_cb)
5103  */
5104  __pyx_t_1 = (__pyx_v_cb != Py_None);
5105  __pyx_t_2 = (__pyx_t_1 != 0);
5106  if (__pyx_t_2) {
5107 
5108  /* "freenect.pyx":359
5109  * global _video_cb
5110  * if cb is not None:
5111  * _video_cb = cb # <<<<<<<<<<<<<<
5112  * freenect_set_video_callback(dev._ptr, video_cb)
5113  * else:
5114  */
5115  if (PyDict_SetItem(__pyx_d, __pyx_n_s_video_cb, __pyx_v_cb) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5116 
5117  /* "freenect.pyx":360
5118  * if cb is not None:
5119  * _video_cb = cb
5120  * freenect_set_video_callback(dev._ptr, video_cb) # <<<<<<<<<<<<<<
5121  * else:
5122  * _video_cb = None
5123  */
5124  freenect_set_video_callback(__pyx_v_dev->_ptr, __pyx_f_8freenect_video_cb);
5125  goto __pyx_L3;
5126  }
5127  /*else*/ {
5128 
5129  /* "freenect.pyx":362
5130  * freenect_set_video_callback(dev._ptr, video_cb)
5131  * else:
5132  * _video_cb = None # <<<<<<<<<<<<<<
5133  * freenect_set_video_callback(dev._ptr, NULL)
5134  *
5135  */
5136  if (PyDict_SetItem(__pyx_d, __pyx_n_s_video_cb, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5137 
5138  /* "freenect.pyx":363
5139  * else:
5140  * _video_cb = None
5141  * freenect_set_video_callback(dev._ptr, NULL) # <<<<<<<<<<<<<<
5142  *
5143  *
5144  */
5145  freenect_set_video_callback(__pyx_v_dev->_ptr, NULL);
5146  }
5147  __pyx_L3:;
5148 
5149  /* "freenect.pyx":356
5150  * freenect_set_depth_callback(dev._ptr, NULL)
5151  *
5152  * def set_video_callback(DevPtr dev, cb): # <<<<<<<<<<<<<<
5153  * global _video_cb
5154  * if cb is not None:
5155  */
5156 
5157  /* function exit code */
5158  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5159  goto __pyx_L0;
5160  __pyx_L1_error:;
5161  __Pyx_AddTraceback("freenect.set_video_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
5162  __pyx_r = NULL;
5163  __pyx_L0:;
5164  __Pyx_XGIVEREF(__pyx_r);
5165  __Pyx_RefNannyFinishContext();
5166  return __pyx_r;
5167 }
5168 
5169 /* "freenect.pyx":370
5170  *
5171  *
5172  * def runloop(depth=None, video=None, body=None, dev=None): # <<<<<<<<<<<<<<
5173  * """Sets up the kinect and maintains a runloop
5174  *
5175  */
5176 
5177 /* Python wrapper */
5178 static PyObject *__pyx_pw_8freenect_49runloop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5179 static char __pyx_doc_8freenect_48runloop[] = "Sets up the kinect and maintains a runloop\n\n This is where most of the action happens. You can get the dev pointer from the callback\n and let this function do all of the setup for you. You may want to use threads to perform\n computation externally as the callbacks should really just be used for copying data.\n\n Args:\n depth: A function that takes (dev, depth, timestamp), corresponding to C function.\n If None (default), then you won't get a callback for depth.\n video: A function that takes (dev, video, timestamp), corresponding to C function.\n If None (default), then you won't get a callback for video.\n body: A function that takes (dev, ctx) and is called in the body of process_events\n dev: Optional freenect device context. If supplied, this function will use it instead\n of creating and destroying its own..\n ";
5180 static PyMethodDef __pyx_mdef_8freenect_49runloop = {__Pyx_NAMESTR("runloop"), (PyCFunction)__pyx_pw_8freenect_49runloop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8freenect_48runloop)};
5181 static PyObject *__pyx_pw_8freenect_49runloop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5182  PyObject *__pyx_v_depth = 0;
5183  PyObject *__pyx_v_video = 0;
5184  PyObject *__pyx_v_body = 0;
5185  PyObject *__pyx_v_dev = 0;
5186  int __pyx_lineno = 0;
5187  const char *__pyx_filename = NULL;
5188  int __pyx_clineno = 0;
5189  PyObject *__pyx_r = 0;
5190  __Pyx_RefNannyDeclarations
5191  __Pyx_RefNannySetupContext("runloop (wrapper)", 0);
5192  {
5193  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_depth,&__pyx_n_s_video,&__pyx_n_s_body,&__pyx_n_s_dev,0};
5194  PyObject* values[4] = {0,0,0,0};
5195  values[0] = ((PyObject *)Py_None);
5196  values[1] = ((PyObject *)Py_None);
5197  values[2] = ((PyObject *)Py_None);
5198  values[3] = ((PyObject *)Py_None);
5199  if (unlikely(__pyx_kwds)) {
5200  Py_ssize_t kw_args;
5201  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5202  switch (pos_args) {
5203  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5204  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5205  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5206  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5207  case 0: break;
5208  default: goto __pyx_L5_argtuple_error;
5209  }
5210  kw_args = PyDict_Size(__pyx_kwds);
5211  switch (pos_args) {
5212  case 0:
5213  if (kw_args > 0) {
5214  PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth);
5215  if (value) { values[0] = value; kw_args--; }
5216  }
5217  case 1:
5218  if (kw_args > 0) {
5219  PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_video);
5220  if (value) { values[1] = value; kw_args--; }
5221  }
5222  case 2:
5223  if (kw_args > 0) {
5224  PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_body);
5225  if (value) { values[2] = value; kw_args--; }
5226  }
5227  case 3:
5228  if (kw_args > 0) {
5229  PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev);
5230  if (value) { values[3] = value; kw_args--; }
5231  }
5232  }
5233  if (unlikely(kw_args > 0)) {
5234  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "runloop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5235  }
5236  } else {
5237  switch (PyTuple_GET_SIZE(__pyx_args)) {
5238  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5239  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5240  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5241  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5242  case 0: break;
5243  default: goto __pyx_L5_argtuple_error;
5244  }
5245  }
5246  __pyx_v_depth = values[0];
5247  __pyx_v_video = values[1];
5248  __pyx_v_body = values[2];
5249  __pyx_v_dev = values[3];
5250  }
5251  goto __pyx_L4_argument_unpacking_done;
5252  __pyx_L5_argtuple_error:;
5253  __Pyx_RaiseArgtupleInvalid("runloop", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5254  __pyx_L3_error:;
5255  __Pyx_AddTraceback("freenect.runloop", __pyx_clineno, __pyx_lineno, __pyx_filename);
5256  __Pyx_RefNannyFinishContext();
5257  return NULL;
5258  __pyx_L4_argument_unpacking_done:;
5259  __pyx_r = __pyx_pf_8freenect_48runloop(__pyx_self, __pyx_v_depth, __pyx_v_video, __pyx_v_body, __pyx_v_dev);
5260 
5261  /* function exit code */
5262  __Pyx_RefNannyFinishContext();
5263  return __pyx_r;
5264 }
5265 
5266 static PyObject *__pyx_pf_8freenect_48runloop(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_depth, PyObject *__pyx_v_video, PyObject *__pyx_v_body, PyObject *__pyx_v_dev) {
5267  struct __pyx_obj_8freenect_DevPtr *__pyx_v_mdev = 0;
5268  struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx = 0;
5269  freenect_device *__pyx_v_devp;
5270  freenect_context *__pyx_v_ctxp;
5271  PyObject *__pyx_r = NULL;
5272  __Pyx_RefNannyDeclarations
5273  int __pyx_t_1;
5274  int __pyx_t_2;
5275  PyObject *__pyx_t_3 = NULL;
5276  PyObject *__pyx_t_4 = NULL;
5277  freenect_device *__pyx_t_5;
5278  freenect_context *__pyx_t_6;
5279  PyObject *__pyx_t_7 = NULL;
5280  PyObject *__pyx_t_8 = NULL;
5281  PyObject *__pyx_t_9 = NULL;
5282  int __pyx_t_10;
5283  int __pyx_lineno = 0;
5284  const char *__pyx_filename = NULL;
5285  int __pyx_clineno = 0;
5286  __Pyx_RefNannySetupContext("runloop", 0);
5287 
5288  /* "freenect.pyx":387
5289  * """
5290  * global _depth_cb, _video_cb
5291  * if depth: # <<<<<<<<<<<<<<
5292  * _depth_cb = depth
5293  * if video:
5294  */
5295  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_depth); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5296  if (__pyx_t_1) {
5297 
5298  /* "freenect.pyx":388
5299  * global _depth_cb, _video_cb
5300  * if depth:
5301  * _depth_cb = depth # <<<<<<<<<<<<<<
5302  * if video:
5303  * _video_cb = video
5304  */
5305  if (PyDict_SetItem(__pyx_d, __pyx_n_s_depth_cb, __pyx_v_depth) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5306  goto __pyx_L3;
5307  }
5308  __pyx_L3:;
5309 
5310  /* "freenect.pyx":389
5311  * if depth:
5312  * _depth_cb = depth
5313  * if video: # <<<<<<<<<<<<<<
5314  * _video_cb = video
5315  * cdef DevPtr mdev
5316  */
5317  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_video); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5318  if (__pyx_t_1) {
5319 
5320  /* "freenect.pyx":390
5321  * _depth_cb = depth
5322  * if video:
5323  * _video_cb = video # <<<<<<<<<<<<<<
5324  * cdef DevPtr mdev
5325  * cdef CtxPtr ctx
5326  */
5327  if (PyDict_SetItem(__pyx_d, __pyx_n_s_video_cb, __pyx_v_video) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5328  goto __pyx_L4;
5329  }
5330  __pyx_L4:;
5331 
5332  /* "freenect.pyx":395
5333  * cdef freenect_device* devp
5334  * cdef freenect_context* ctxp
5335  * if dev is None: # <<<<<<<<<<<<<<
5336  * ctx = init()
5337  * if not ctx:
5338  */
5339  __pyx_t_1 = (__pyx_v_dev == Py_None);
5340  __pyx_t_2 = (__pyx_t_1 != 0);
5341  if (__pyx_t_2) {
5342 
5343  /* "freenect.pyx":396
5344  * cdef freenect_context* ctxp
5345  * if dev is None:
5346  * ctx = init() # <<<<<<<<<<<<<<
5347  * if not ctx:
5348  * error_open_device()
5349  */
5350  __pyx_t_3 = __pyx_f_8freenect_init(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5351  __Pyx_GOTREF(__pyx_t_3);
5352  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_8freenect_CtxPtr))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5353  __pyx_v_ctx = ((struct __pyx_obj_8freenect_CtxPtr *)__pyx_t_3);
5354  __pyx_t_3 = 0;
5355 
5356  /* "freenect.pyx":397
5357  * if dev is None:
5358  * ctx = init()
5359  * if not ctx: # <<<<<<<<<<<<<<
5360  * error_open_device()
5361  * return
5362  */
5363  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_ctx)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5364  __pyx_t_1 = ((!__pyx_t_2) != 0);
5365  if (__pyx_t_1) {
5366 
5367  /* "freenect.pyx":398
5368  * ctx = init()
5369  * if not ctx:
5370  * error_open_device() # <<<<<<<<<<<<<<
5371  * return
5372  * mdev = open_device(ctx, 0)
5373  */
5374  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error_open_device); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5375  __Pyx_GOTREF(__pyx_t_3);
5376  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5377  __Pyx_GOTREF(__pyx_t_4);
5378  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5379  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5380 
5381  /* "freenect.pyx":399
5382  * if not ctx:
5383  * error_open_device()
5384  * return # <<<<<<<<<<<<<<
5385  * mdev = open_device(ctx, 0)
5386  * if not mdev:
5387  */
5388  __Pyx_XDECREF(__pyx_r);
5389  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5390  goto __pyx_L0;
5391  }
5392 
5393  /* "freenect.pyx":400
5394  * error_open_device()
5395  * return
5396  * mdev = open_device(ctx, 0) # <<<<<<<<<<<<<<
5397  * if not mdev:
5398  * error_open_device()
5399  */
5400  __pyx_t_4 = __pyx_f_8freenect_open_device(__pyx_v_ctx, 0, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5401  __Pyx_GOTREF(__pyx_t_4);
5402  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_8freenect_DevPtr))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5403  __pyx_v_mdev = ((struct __pyx_obj_8freenect_DevPtr *)__pyx_t_4);
5404  __pyx_t_4 = 0;
5405 
5406  /* "freenect.pyx":401
5407  * return
5408  * mdev = open_device(ctx, 0)
5409  * if not mdev: # <<<<<<<<<<<<<<
5410  * error_open_device()
5411  * return
5412  */
5413  __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_mdev)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5414  __pyx_t_2 = ((!__pyx_t_1) != 0);
5415  if (__pyx_t_2) {
5416 
5417  /* "freenect.pyx":402
5418  * mdev = open_device(ctx, 0)
5419  * if not mdev:
5420  * error_open_device() # <<<<<<<<<<<<<<
5421  * return
5422  * if depth is not None:
5423  */
5424  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error_open_device); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5425  __Pyx_GOTREF(__pyx_t_4);
5426  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5427  __Pyx_GOTREF(__pyx_t_3);
5428  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5429  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5430 
5431  /* "freenect.pyx":403
5432  * if not mdev:
5433  * error_open_device()
5434  * return # <<<<<<<<<<<<<<
5435  * if depth is not None:
5436  * freenect_set_depth_mode(mdev._ptr, freenect_find_depth_mode(FREENECT_RESOLUTION_MEDIUM, FREENECT_DEPTH_11BIT))
5437  */
5438  __Pyx_XDECREF(__pyx_r);
5439  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5440  goto __pyx_L0;
5441  }
5442 
5443  /* "freenect.pyx":404
5444  * error_open_device()
5445  * return
5446  * if depth is not None: # <<<<<<<<<<<<<<
5447  * freenect_set_depth_mode(mdev._ptr, freenect_find_depth_mode(FREENECT_RESOLUTION_MEDIUM, FREENECT_DEPTH_11BIT))
5448  * if video is not None:
5449  */
5450  __pyx_t_2 = (__pyx_v_depth != Py_None);
5451  __pyx_t_1 = (__pyx_t_2 != 0);
5452  if (__pyx_t_1) {
5453 
5454  /* "freenect.pyx":405
5455  * return
5456  * if depth is not None:
5457  * freenect_set_depth_mode(mdev._ptr, freenect_find_depth_mode(FREENECT_RESOLUTION_MEDIUM, FREENECT_DEPTH_11BIT)) # <<<<<<<<<<<<<<
5458  * if video is not None:
5459  * freenect_set_video_mode(mdev._ptr, freenect_find_video_mode(FREENECT_RESOLUTION_MEDIUM, FREENECT_VIDEO_RGB))
5460  */
5462  goto __pyx_L8;
5463  }
5464  __pyx_L8:;
5465 
5466  /* "freenect.pyx":406
5467  * if depth is not None:
5468  * freenect_set_depth_mode(mdev._ptr, freenect_find_depth_mode(FREENECT_RESOLUTION_MEDIUM, FREENECT_DEPTH_11BIT))
5469  * if video is not None: # <<<<<<<<<<<<<<
5470  * freenect_set_video_mode(mdev._ptr, freenect_find_video_mode(FREENECT_RESOLUTION_MEDIUM, FREENECT_VIDEO_RGB))
5471  *
5472  */
5473  __pyx_t_1 = (__pyx_v_video != Py_None);
5474  __pyx_t_2 = (__pyx_t_1 != 0);
5475  if (__pyx_t_2) {
5476 
5477  /* "freenect.pyx":407
5478  * freenect_set_depth_mode(mdev._ptr, freenect_find_depth_mode(FREENECT_RESOLUTION_MEDIUM, FREENECT_DEPTH_11BIT))
5479  * if video is not None:
5480  * freenect_set_video_mode(mdev._ptr, freenect_find_video_mode(FREENECT_RESOLUTION_MEDIUM, FREENECT_VIDEO_RGB)) # <<<<<<<<<<<<<<
5481  *
5482  * else:
5483  */
5485  goto __pyx_L9;
5486  }
5487  __pyx_L9:;
5488  goto __pyx_L5;
5489  }
5490  /*else*/ {
5491 
5492  /* "freenect.pyx":410
5493  *
5494  * else:
5495  * mdev = dev # <<<<<<<<<<<<<<
5496  * devp = mdev._ptr
5497  * ctxp = mdev.ctx._ptr
5498  */
5499  if (!(likely(((__pyx_v_dev) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dev, __pyx_ptype_8freenect_DevPtr))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5500  __pyx_t_3 = __pyx_v_dev;
5501  __Pyx_INCREF(__pyx_t_3);
5502  __pyx_v_mdev = ((struct __pyx_obj_8freenect_DevPtr *)__pyx_t_3);
5503  __pyx_t_3 = 0;
5504  }
5505  __pyx_L5:;
5506 
5507  /* "freenect.pyx":411
5508  * else:
5509  * mdev = dev
5510  * devp = mdev._ptr # <<<<<<<<<<<<<<
5511  * ctxp = mdev.ctx._ptr
5512  * if depth is not None:
5513  */
5514  __pyx_t_5 = __pyx_v_mdev->_ptr;
5515  __pyx_v_devp = __pyx_t_5;
5516 
5517  /* "freenect.pyx":412
5518  * mdev = dev
5519  * devp = mdev._ptr
5520  * ctxp = mdev.ctx._ptr # <<<<<<<<<<<<<<
5521  * if depth is not None:
5522  * freenect_start_depth(devp)
5523  */
5524  __pyx_t_6 = __pyx_v_mdev->ctx->_ptr;
5525  __pyx_v_ctxp = __pyx_t_6;
5526 
5527  /* "freenect.pyx":413
5528  * devp = mdev._ptr
5529  * ctxp = mdev.ctx._ptr
5530  * if depth is not None: # <<<<<<<<<<<<<<
5531  * freenect_start_depth(devp)
5532  * freenect_set_depth_callback(devp, depth_cb)
5533  */
5534  __pyx_t_2 = (__pyx_v_depth != Py_None);
5535  __pyx_t_1 = (__pyx_t_2 != 0);
5536  if (__pyx_t_1) {
5537 
5538  /* "freenect.pyx":414
5539  * ctxp = mdev.ctx._ptr
5540  * if depth is not None:
5541  * freenect_start_depth(devp) # <<<<<<<<<<<<<<
5542  * freenect_set_depth_callback(devp, depth_cb)
5543  * if video is not None:
5544  */
5545  freenect_start_depth(__pyx_v_devp);
5546 
5547  /* "freenect.pyx":415
5548  * if depth is not None:
5549  * freenect_start_depth(devp)
5550  * freenect_set_depth_callback(devp, depth_cb) # <<<<<<<<<<<<<<
5551  * if video is not None:
5552  * freenect_start_video(devp)
5553  */
5554  freenect_set_depth_callback(__pyx_v_devp, __pyx_f_8freenect_depth_cb);
5555  goto __pyx_L10;
5556  }
5557  __pyx_L10:;
5558 
5559  /* "freenect.pyx":416
5560  * freenect_start_depth(devp)
5561  * freenect_set_depth_callback(devp, depth_cb)
5562  * if video is not None: # <<<<<<<<<<<<<<
5563  * freenect_start_video(devp)
5564  * freenect_set_video_callback(devp, video_cb)
5565  */
5566  __pyx_t_1 = (__pyx_v_video != Py_None);
5567  __pyx_t_2 = (__pyx_t_1 != 0);
5568  if (__pyx_t_2) {
5569 
5570  /* "freenect.pyx":417
5571  * freenect_set_depth_callback(devp, depth_cb)
5572  * if video is not None:
5573  * freenect_start_video(devp) # <<<<<<<<<<<<<<
5574  * freenect_set_video_callback(devp, video_cb)
5575  * try:
5576  */
5577  freenect_start_video(__pyx_v_devp);
5578 
5579  /* "freenect.pyx":418
5580  * if video is not None:
5581  * freenect_start_video(devp)
5582  * freenect_set_video_callback(devp, video_cb) # <<<<<<<<<<<<<<
5583  * try:
5584  * while True:
5585  */
5586  freenect_set_video_callback(__pyx_v_devp, __pyx_f_8freenect_video_cb);
5587  goto __pyx_L11;
5588  }
5589  __pyx_L11:;
5590 
5591  /* "freenect.pyx":419
5592  * freenect_start_video(devp)
5593  * freenect_set_video_callback(devp, video_cb)
5594  * try: # <<<<<<<<<<<<<<
5595  * while True:
5596  * with nogil:
5597  */
5598  {
5599  __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
5600  __Pyx_XGOTREF(__pyx_t_7);
5601  __Pyx_XGOTREF(__pyx_t_8);
5602  __Pyx_XGOTREF(__pyx_t_9);
5603  /*try:*/ {
5604 
5605  /* "freenect.pyx":420
5606  * freenect_set_video_callback(devp, video_cb)
5607  * try:
5608  * while True: # <<<<<<<<<<<<<<
5609  * with nogil:
5610  * if freenect_process_events(ctxp) < 0:
5611  */
5612  while (1) {
5613 
5614  /* "freenect.pyx":421
5615  * try:
5616  * while True:
5617  * with nogil: # <<<<<<<<<<<<<<
5618  * if freenect_process_events(ctxp) < 0:
5619  * break
5620  */
5621  {
5622  #ifdef WITH_THREAD
5623  PyThreadState *_save;
5624  Py_UNBLOCK_THREADS
5625  #endif
5626  /*try:*/ {
5627 
5628  /* "freenect.pyx":422
5629  * while True:
5630  * with nogil:
5631  * if freenect_process_events(ctxp) < 0: # <<<<<<<<<<<<<<
5632  * break
5633  * if body:
5634  */
5635  __pyx_t_2 = ((freenect_process_events(__pyx_v_ctxp) < 0) != 0);
5636  if (__pyx_t_2) {
5637 
5638  /* "freenect.pyx":423
5639  * with nogil:
5640  * if freenect_process_events(ctxp) < 0:
5641  * break # <<<<<<<<<<<<<<
5642  * if body:
5643  * body(mdev, mdev.ctx)
5644  */
5645  goto __pyx_L23_break;
5646  }
5647  }
5648 
5649  /* "freenect.pyx":421
5650  * try:
5651  * while True:
5652  * with nogil: # <<<<<<<<<<<<<<
5653  * if freenect_process_events(ctxp) < 0:
5654  * break
5655  */
5656  /*finally:*/ {
5657  /*normal exit:*/{
5658  #ifdef WITH_THREAD
5659  Py_BLOCK_THREADS
5660  #endif
5661  goto __pyx_L26;
5662  }
5663  __pyx_L23_break: {
5664  #ifdef WITH_THREAD
5665  Py_BLOCK_THREADS
5666  #endif
5667  goto __pyx_L21_break;
5668  }
5669  __pyx_L26:;
5670  }
5671  }
5672 
5673  /* "freenect.pyx":424
5674  * if freenect_process_events(ctxp) < 0:
5675  * break
5676  * if body: # <<<<<<<<<<<<<<
5677  * body(mdev, mdev.ctx)
5678  * except Kill:
5679  */
5680  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_body); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
5681  if (__pyx_t_2) {
5682 
5683  /* "freenect.pyx":425
5684  * break
5685  * if body:
5686  * body(mdev, mdev.ctx) # <<<<<<<<<<<<<<
5687  * except Kill:
5688  * pass
5689  */
5690  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
5691  __Pyx_GOTREF(__pyx_t_3);
5692  __Pyx_INCREF(((PyObject *)__pyx_v_mdev));
5693  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_mdev));
5694  __Pyx_GIVEREF(((PyObject *)__pyx_v_mdev));
5695  __Pyx_INCREF(((PyObject *)__pyx_v_mdev->ctx));
5696  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_mdev->ctx));
5697  __Pyx_GIVEREF(((PyObject *)__pyx_v_mdev->ctx));
5698  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_body, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
5699  __Pyx_GOTREF(__pyx_t_4);
5700  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5701  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5702  goto __pyx_L28;
5703  }
5704  __pyx_L28:;
5705  }
5706  __pyx_L21_break:;
5707  }
5708  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5709  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
5710  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5711  goto __pyx_L19_try_end;
5712  __pyx_L12_error:;
5713  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5714  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5715 
5716  /* "freenect.pyx":426
5717  * if body:
5718  * body(mdev, mdev.ctx)
5719  * except Kill: # <<<<<<<<<<<<<<
5720  * pass
5721  * freenect_stop_depth(devp)
5722  */
5723  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Kill); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
5724  __Pyx_GOTREF(__pyx_t_4);
5725  __pyx_t_10 = PyErr_ExceptionMatches(__pyx_t_4);
5726  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5727  if (__pyx_t_10) {
5728  PyErr_Restore(0,0,0);
5729  goto __pyx_L13_exception_handled;
5730  }
5731  goto __pyx_L14_except_error;
5732  __pyx_L14_except_error:;
5733  __Pyx_XGIVEREF(__pyx_t_7);
5734  __Pyx_XGIVEREF(__pyx_t_8);
5735  __Pyx_XGIVEREF(__pyx_t_9);
5736  __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
5737  goto __pyx_L1_error;
5738  __pyx_L13_exception_handled:;
5739  __Pyx_XGIVEREF(__pyx_t_7);
5740  __Pyx_XGIVEREF(__pyx_t_8);
5741  __Pyx_XGIVEREF(__pyx_t_9);
5742  __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
5743  __pyx_L19_try_end:;
5744  }
5745 
5746  /* "freenect.pyx":428
5747  * except Kill:
5748  * pass
5749  * freenect_stop_depth(devp) # <<<<<<<<<<<<<<
5750  * freenect_stop_video(devp)
5751  * if dev is None:
5752  */
5753  freenect_stop_depth(__pyx_v_devp);
5754 
5755  /* "freenect.pyx":429
5756  * pass
5757  * freenect_stop_depth(devp)
5758  * freenect_stop_video(devp) # <<<<<<<<<<<<<<
5759  * if dev is None:
5760  * freenect_close_device(devp)
5761  */
5762  freenect_stop_video(__pyx_v_devp);
5763 
5764  /* "freenect.pyx":430
5765  * freenect_stop_depth(devp)
5766  * freenect_stop_video(devp)
5767  * if dev is None: # <<<<<<<<<<<<<<
5768  * freenect_close_device(devp)
5769  * freenect_shutdown(ctxp)
5770  */
5771  __pyx_t_2 = (__pyx_v_dev == Py_None);
5772  __pyx_t_1 = (__pyx_t_2 != 0);
5773  if (__pyx_t_1) {
5774 
5775  /* "freenect.pyx":431
5776  * freenect_stop_video(devp)
5777  * if dev is None:
5778  * freenect_close_device(devp) # <<<<<<<<<<<<<<
5779  * freenect_shutdown(ctxp)
5780  *
5781  */
5782  freenect_close_device(__pyx_v_devp);
5783 
5784  /* "freenect.pyx":432
5785  * if dev is None:
5786  * freenect_close_device(devp)
5787  * freenect_shutdown(ctxp) # <<<<<<<<<<<<<<
5788  *
5789  * def base_runloop(CtxPtr ctx, body=None):
5790  */
5791  freenect_shutdown(__pyx_v_ctxp);
5792  goto __pyx_L29;
5793  }
5794  __pyx_L29:;
5795 
5796  /* "freenect.pyx":370
5797  *
5798  *
5799  * def runloop(depth=None, video=None, body=None, dev=None): # <<<<<<<<<<<<<<
5800  * """Sets up the kinect and maintains a runloop
5801  *
5802  */
5803 
5804  /* function exit code */
5805  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5806  goto __pyx_L0;
5807  __pyx_L1_error:;
5808  __Pyx_XDECREF(__pyx_t_3);
5809  __Pyx_XDECREF(__pyx_t_4);
5810  __Pyx_AddTraceback("freenect.runloop", __pyx_clineno, __pyx_lineno, __pyx_filename);
5811  __pyx_r = NULL;
5812  __pyx_L0:;
5813  __Pyx_XDECREF((PyObject *)__pyx_v_mdev);
5814  __Pyx_XDECREF((PyObject *)__pyx_v_ctx);
5815  __Pyx_XGIVEREF(__pyx_r);
5816  __Pyx_RefNannyFinishContext();
5817  return __pyx_r;
5818 }
5819 
5820 /* "freenect.pyx":434
5821  * freenect_shutdown(ctxp)
5822  *
5823  * def base_runloop(CtxPtr ctx, body=None): # <<<<<<<<<<<<<<
5824  * """Starts a runloop
5825  *
5826  */
5827 
5828 /* Python wrapper */
5829 static PyObject *__pyx_pw_8freenect_51base_runloop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5830 static char __pyx_doc_8freenect_50base_runloop[] = "Starts a runloop\n\n This function can be used instead of runloop() to allow the Python code to\n perform all setup steps independently. This simply calls process_events in\n a loop, optionally calling a body function in between. Raise the Kill\n exception to break out of the runloop.\n\n Args:\n ctx: Freenect library context\n body: A function that takes (ctx) and is called in the body of process_events\n ";
5831 static PyMethodDef __pyx_mdef_8freenect_51base_runloop = {__Pyx_NAMESTR("base_runloop"), (PyCFunction)__pyx_pw_8freenect_51base_runloop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8freenect_50base_runloop)};
5832 static PyObject *__pyx_pw_8freenect_51base_runloop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5833  struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx = 0;
5834  PyObject *__pyx_v_body = 0;
5835  int __pyx_lineno = 0;
5836  const char *__pyx_filename = NULL;
5837  int __pyx_clineno = 0;
5838  PyObject *__pyx_r = 0;
5839  __Pyx_RefNannyDeclarations
5840  __Pyx_RefNannySetupContext("base_runloop (wrapper)", 0);
5841  {
5842  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctx,&__pyx_n_s_body,0};
5843  PyObject* values[2] = {0,0};
5844  values[1] = ((PyObject *)Py_None);
5845  if (unlikely(__pyx_kwds)) {
5846  Py_ssize_t kw_args;
5847  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5848  switch (pos_args) {
5849  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5850  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5851  case 0: break;
5852  default: goto __pyx_L5_argtuple_error;
5853  }
5854  kw_args = PyDict_Size(__pyx_kwds);
5855  switch (pos_args) {
5856  case 0:
5857  if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ctx)) != 0)) kw_args--;
5858  else goto __pyx_L5_argtuple_error;
5859  case 1:
5860  if (kw_args > 0) {
5861  PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_body);
5862  if (value) { values[1] = value; kw_args--; }
5863  }
5864  }
5865  if (unlikely(kw_args > 0)) {
5866  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "base_runloop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5867  }
5868  } else {
5869  switch (PyTuple_GET_SIZE(__pyx_args)) {
5870  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5871  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5872  break;
5873  default: goto __pyx_L5_argtuple_error;
5874  }
5875  }
5876  __pyx_v_ctx = ((struct __pyx_obj_8freenect_CtxPtr *)values[0]);
5877  __pyx_v_body = values[1];
5878  }
5879  goto __pyx_L4_argument_unpacking_done;
5880  __pyx_L5_argtuple_error:;
5881  __Pyx_RaiseArgtupleInvalid("base_runloop", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5882  __pyx_L3_error:;
5883  __Pyx_AddTraceback("freenect.base_runloop", __pyx_clineno, __pyx_lineno, __pyx_filename);
5884  __Pyx_RefNannyFinishContext();
5885  return NULL;
5886  __pyx_L4_argument_unpacking_done:;
5887  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_8freenect_CtxPtr, 1, "ctx", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5888  __pyx_r = __pyx_pf_8freenect_50base_runloop(__pyx_self, __pyx_v_ctx, __pyx_v_body);
5889 
5890  /* function exit code */
5891  goto __pyx_L0;
5892  __pyx_L1_error:;
5893  __pyx_r = NULL;
5894  __pyx_L0:;
5895  __Pyx_RefNannyFinishContext();
5896  return __pyx_r;
5897 }
5898 
5899 static PyObject *__pyx_pf_8freenect_50base_runloop(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx, PyObject *__pyx_v_body) {
5900  freenect_context *__pyx_v_ctxp;
5901  PyObject *__pyx_r = NULL;
5902  __Pyx_RefNannyDeclarations
5903  freenect_context *__pyx_t_1;
5904  PyObject *__pyx_t_2 = NULL;
5905  PyObject *__pyx_t_3 = NULL;
5906  PyObject *__pyx_t_4 = NULL;
5907  int __pyx_t_5;
5908  PyObject *__pyx_t_6 = NULL;
5909  PyObject *__pyx_t_7 = NULL;
5910  int __pyx_t_8;
5911  int __pyx_lineno = 0;
5912  const char *__pyx_filename = NULL;
5913  int __pyx_clineno = 0;
5914  __Pyx_RefNannySetupContext("base_runloop", 0);
5915 
5916  /* "freenect.pyx":447
5917  * """
5918  * cdef freenect_context* ctxp
5919  * ctxp = ctx._ptr # <<<<<<<<<<<<<<
5920  * try:
5921  * while True:
5922  */
5923  __pyx_t_1 = __pyx_v_ctx->_ptr;
5924  __pyx_v_ctxp = __pyx_t_1;
5925 
5926  /* "freenect.pyx":448
5927  * cdef freenect_context* ctxp
5928  * ctxp = ctx._ptr
5929  * try: # <<<<<<<<<<<<<<
5930  * while True:
5931  * with nogil:
5932  */
5933  {
5934  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
5935  __Pyx_XGOTREF(__pyx_t_2);
5936  __Pyx_XGOTREF(__pyx_t_3);
5937  __Pyx_XGOTREF(__pyx_t_4);
5938  /*try:*/ {
5939 
5940  /* "freenect.pyx":449
5941  * ctxp = ctx._ptr
5942  * try:
5943  * while True: # <<<<<<<<<<<<<<
5944  * with nogil:
5945  * if freenect_process_events(ctxp) < 0:
5946  */
5947  while (1) {
5948 
5949  /* "freenect.pyx":450
5950  * try:
5951  * while True:
5952  * with nogil: # <<<<<<<<<<<<<<
5953  * if freenect_process_events(ctxp) < 0:
5954  * break
5955  */
5956  {
5957  #ifdef WITH_THREAD
5958  PyThreadState *_save;
5959  Py_UNBLOCK_THREADS
5960  #endif
5961  /*try:*/ {
5962 
5963  /* "freenect.pyx":451
5964  * while True:
5965  * with nogil:
5966  * if freenect_process_events(ctxp) < 0: # <<<<<<<<<<<<<<
5967  * break
5968  * if body:
5969  */
5970  __pyx_t_5 = ((freenect_process_events(__pyx_v_ctxp) < 0) != 0);
5971  if (__pyx_t_5) {
5972 
5973  /* "freenect.pyx":452
5974  * with nogil:
5975  * if freenect_process_events(ctxp) < 0:
5976  * break # <<<<<<<<<<<<<<
5977  * if body:
5978  * body(ctx)
5979  */
5980  goto __pyx_L14_break;
5981  }
5982  }
5983 
5984  /* "freenect.pyx":450
5985  * try:
5986  * while True:
5987  * with nogil: # <<<<<<<<<<<<<<
5988  * if freenect_process_events(ctxp) < 0:
5989  * break
5990  */
5991  /*finally:*/ {
5992  /*normal exit:*/{
5993  #ifdef WITH_THREAD
5994  Py_BLOCK_THREADS
5995  #endif
5996  goto __pyx_L17;
5997  }
5998  __pyx_L14_break: {
5999  #ifdef WITH_THREAD
6000  Py_BLOCK_THREADS
6001  #endif
6002  goto __pyx_L12_break;
6003  }
6004  __pyx_L17:;
6005  }
6006  }
6007 
6008  /* "freenect.pyx":453
6009  * if freenect_process_events(ctxp) < 0:
6010  * break
6011  * if body: # <<<<<<<<<<<<<<
6012  * body(ctx)
6013  * except Kill:
6014  */
6015  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_body); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6016  if (__pyx_t_5) {
6017 
6018  /* "freenect.pyx":454
6019  * break
6020  * if body:
6021  * body(ctx) # <<<<<<<<<<<<<<
6022  * except Kill:
6023  * pass
6024  */
6025  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6026  __Pyx_GOTREF(__pyx_t_6);
6027  __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
6028  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_ctx));
6029  __Pyx_GIVEREF(((PyObject *)__pyx_v_ctx));
6030  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_body, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6031  __Pyx_GOTREF(__pyx_t_7);
6032  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6033  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6034  goto __pyx_L19;
6035  }
6036  __pyx_L19:;
6037  }
6038  __pyx_L12_break:;
6039  }
6040  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6041  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6042  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6043  goto __pyx_L10_try_end;
6044  __pyx_L3_error:;
6045  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6046  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6047 
6048  /* "freenect.pyx":455
6049  * if body:
6050  * body(ctx)
6051  * except Kill: # <<<<<<<<<<<<<<
6052  * pass
6053  *
6054  */
6055  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_Kill); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
6056  __Pyx_GOTREF(__pyx_t_7);
6057  __pyx_t_8 = PyErr_ExceptionMatches(__pyx_t_7);
6058  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6059  if (__pyx_t_8) {
6060  PyErr_Restore(0,0,0);
6061  goto __pyx_L4_exception_handled;
6062  }
6063  goto __pyx_L5_except_error;
6064  __pyx_L5_except_error:;
6065  __Pyx_XGIVEREF(__pyx_t_2);
6066  __Pyx_XGIVEREF(__pyx_t_3);
6067  __Pyx_XGIVEREF(__pyx_t_4);
6068  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
6069  goto __pyx_L1_error;
6070  __pyx_L4_exception_handled:;
6071  __Pyx_XGIVEREF(__pyx_t_2);
6072  __Pyx_XGIVEREF(__pyx_t_3);
6073  __Pyx_XGIVEREF(__pyx_t_4);
6074  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
6075  __pyx_L10_try_end:;
6076  }
6077 
6078  /* "freenect.pyx":434
6079  * freenect_shutdown(ctxp)
6080  *
6081  * def base_runloop(CtxPtr ctx, body=None): # <<<<<<<<<<<<<<
6082  * """Starts a runloop
6083  *
6084  */
6085 
6086  /* function exit code */
6087  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6088  goto __pyx_L0;
6089  __pyx_L1_error:;
6090  __Pyx_XDECREF(__pyx_t_6);
6091  __Pyx_XDECREF(__pyx_t_7);
6092  __Pyx_AddTraceback("freenect.base_runloop", __pyx_clineno, __pyx_lineno, __pyx_filename);
6093  __pyx_r = NULL;
6094  __pyx_L0:;
6095  __Pyx_XGIVEREF(__pyx_r);
6096  __Pyx_RefNannyFinishContext();
6097  return __pyx_r;
6098 }
6099 
6100 /* "freenect.pyx":460
6101  * import_array()
6102  *
6103  * cdef object _depth_cb_np(void *data, freenect_frame_mode *mode): # <<<<<<<<<<<<<<
6104  * cdef npc.npy_intp dims[2]
6105  *
6106  */
6107 
6108 static PyObject *__pyx_f_8freenect__depth_cb_np(void *__pyx_v_data, freenect_frame_mode *__pyx_v_mode) {
6109  npy_intp __pyx_v_dims[2];
6110  PyObject *__pyx_r = NULL;
6111  __Pyx_RefNannyDeclarations
6112  int32_t __pyx_t_1;
6113  PyObject *__pyx_t_2 = NULL;
6114  PyObject *__pyx_t_3 = NULL;
6115  PyObject *__pyx_t_4 = NULL;
6116  int __pyx_t_5;
6117  int __pyx_t_6;
6118  int __pyx_t_7;
6119  int16_t __pyx_t_8;
6120  int16_t __pyx_t_9;
6121  int __pyx_lineno = 0;
6122  const char *__pyx_filename = NULL;
6123  int __pyx_clineno = 0;
6124  __Pyx_RefNannySetupContext("_depth_cb_np", 0);
6125 
6126  /* "freenect.pyx":463
6127  * cdef npc.npy_intp dims[2]
6128  *
6129  * if mode.video_format in (DEPTH_11BIT, DEPTH_10BIT, DEPTH_REGISTERED, DEPTH_MM): # <<<<<<<<<<<<<<
6130  * dims[0], dims[1] = mode.height, mode.width
6131  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data)
6132  */
6133  __pyx_t_1 = __pyx_v_mode->video_format;
6134  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6135  __Pyx_GOTREF(__pyx_t_2);
6136  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEPTH_11BIT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6137  __Pyx_GOTREF(__pyx_t_3);
6138  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6139  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6140  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6141  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6142  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6143  if (!__pyx_t_5) {
6144  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6145  __Pyx_GOTREF(__pyx_t_4);
6146  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEPTH_10BIT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6147  __Pyx_GOTREF(__pyx_t_3);
6148  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6149  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6150  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6151  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6152  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6153  __pyx_t_7 = __pyx_t_6;
6154  } else {
6155  __pyx_t_7 = __pyx_t_5;
6156  }
6157  if (!__pyx_t_7) {
6158  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6159  __Pyx_GOTREF(__pyx_t_2);
6160  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEPTH_REGISTERED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6161  __Pyx_GOTREF(__pyx_t_3);
6162  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6163  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6164  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6165  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6166  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6167  __pyx_t_6 = __pyx_t_5;
6168  } else {
6169  __pyx_t_6 = __pyx_t_7;
6170  }
6171  if (!__pyx_t_6) {
6172  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6173  __Pyx_GOTREF(__pyx_t_4);
6174  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEPTH_MM); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6175  __Pyx_GOTREF(__pyx_t_3);
6176  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6177  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6178  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6179  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6180  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6181  __pyx_t_5 = __pyx_t_7;
6182  } else {
6183  __pyx_t_5 = __pyx_t_6;
6184  }
6185  __pyx_t_6 = (__pyx_t_5 != 0);
6186  if (__pyx_t_6) {
6187 
6188  /* "freenect.pyx":464
6189  *
6190  * if mode.video_format in (DEPTH_11BIT, DEPTH_10BIT, DEPTH_REGISTERED, DEPTH_MM):
6191  * dims[0], dims[1] = mode.height, mode.width # <<<<<<<<<<<<<<
6192  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data)
6193  * else:
6194  */
6195  __pyx_t_8 = __pyx_v_mode->height;
6196  __pyx_t_9 = __pyx_v_mode->width;
6197  (__pyx_v_dims[0]) = __pyx_t_8;
6198  (__pyx_v_dims[1]) = __pyx_t_9;
6199 
6200  /* "freenect.pyx":465
6201  * if mode.video_format in (DEPTH_11BIT, DEPTH_10BIT, DEPTH_REGISTERED, DEPTH_MM):
6202  * dims[0], dims[1] = mode.height, mode.width
6203  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data) # <<<<<<<<<<<<<<
6204  * else:
6205  * return (<char *>data)[:mode.bytes]
6206  */
6207  __Pyx_XDECREF(__pyx_r);
6208  __pyx_t_2 = PyArray_SimpleNewFromData(2, __pyx_v_dims, NPY_UINT16, __pyx_v_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6209  __Pyx_GOTREF(__pyx_t_2);
6210  __pyx_r = __pyx_t_2;
6211  __pyx_t_2 = 0;
6212  goto __pyx_L0;
6213  }
6214  /*else*/ {
6215 
6216  /* "freenect.pyx":467
6217  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data)
6218  * else:
6219  * return (<char *>data)[:mode.bytes] # <<<<<<<<<<<<<<
6220  *
6221  *
6222  */
6223  __Pyx_XDECREF(__pyx_r);
6224  __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_data) + 0, __pyx_v_mode->bytes - 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6225  __Pyx_GOTREF(__pyx_t_2);
6226  __pyx_r = __pyx_t_2;
6227  __pyx_t_2 = 0;
6228  goto __pyx_L0;
6229  }
6230 
6231  /* "freenect.pyx":460
6232  * import_array()
6233  *
6234  * cdef object _depth_cb_np(void *data, freenect_frame_mode *mode): # <<<<<<<<<<<<<<
6235  * cdef npc.npy_intp dims[2]
6236  *
6237  */
6238 
6239  /* function exit code */
6240  __pyx_L1_error:;
6241  __Pyx_XDECREF(__pyx_t_2);
6242  __Pyx_XDECREF(__pyx_t_3);
6243  __Pyx_XDECREF(__pyx_t_4);
6244  __Pyx_AddTraceback("freenect._depth_cb_np", __pyx_clineno, __pyx_lineno, __pyx_filename);
6245  __pyx_r = 0;
6246  __pyx_L0:;
6247  __Pyx_XGIVEREF(__pyx_r);
6248  __Pyx_RefNannyFinishContext();
6249  return __pyx_r;
6250 }
6251 
6252 /* "freenect.pyx":470
6253  *
6254  *
6255  * cdef _video_cb_np(void *data, freenect_frame_mode *mode): # <<<<<<<<<<<<<<
6256  * cdef npc.npy_intp dims[3]
6257  *
6258  */
6259 
6260 static PyObject *__pyx_f_8freenect__video_cb_np(void *__pyx_v_data, freenect_frame_mode *__pyx_v_mode) {
6261  npy_intp __pyx_v_dims[3];
6262  PyObject *__pyx_r = NULL;
6263  __Pyx_RefNannyDeclarations
6264  int32_t __pyx_t_1;
6265  PyObject *__pyx_t_2 = NULL;
6266  PyObject *__pyx_t_3 = NULL;
6267  PyObject *__pyx_t_4 = NULL;
6268  int __pyx_t_5;
6269  int __pyx_t_6;
6270  int __pyx_t_7;
6271  int16_t __pyx_t_8;
6272  int16_t __pyx_t_9;
6273  npy_intp __pyx_t_10;
6274  int __pyx_lineno = 0;
6275  const char *__pyx_filename = NULL;
6276  int __pyx_clineno = 0;
6277  __Pyx_RefNannySetupContext("_video_cb_np", 0);
6278 
6279  /* "freenect.pyx":473
6280  * cdef npc.npy_intp dims[3]
6281  *
6282  * if mode.video_format in (VIDEO_RGB, VIDEO_YUV_RGB): # <<<<<<<<<<<<<<
6283  * dims[0], dims[1], dims[2] = mode.height, mode.width, 3
6284  * return PyArray_SimpleNewFromData(3, dims, npc.NPY_UINT8, data)
6285  */
6286  __pyx_t_1 = __pyx_v_mode->video_format;
6287  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6288  __Pyx_GOTREF(__pyx_t_2);
6289  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEO_RGB); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6290  __Pyx_GOTREF(__pyx_t_3);
6291  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6292  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6293  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6294  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6295  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6296  if (!__pyx_t_5) {
6297  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6298  __Pyx_GOTREF(__pyx_t_4);
6299  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEO_YUV_RGB); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6300  __Pyx_GOTREF(__pyx_t_3);
6301  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6302  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6303  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6304  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6305  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6306  __pyx_t_7 = __pyx_t_6;
6307  } else {
6308  __pyx_t_7 = __pyx_t_5;
6309  }
6310  __pyx_t_5 = (__pyx_t_7 != 0);
6311  if (__pyx_t_5) {
6312 
6313  /* "freenect.pyx":474
6314  *
6315  * if mode.video_format in (VIDEO_RGB, VIDEO_YUV_RGB):
6316  * dims[0], dims[1], dims[2] = mode.height, mode.width, 3 # <<<<<<<<<<<<<<
6317  * return PyArray_SimpleNewFromData(3, dims, npc.NPY_UINT8, data)
6318  * elif mode.video_format == VIDEO_IR_8BIT:
6319  */
6320  __pyx_t_8 = __pyx_v_mode->height;
6321  __pyx_t_9 = __pyx_v_mode->width;
6322  __pyx_t_10 = 3;
6323  (__pyx_v_dims[0]) = __pyx_t_8;
6324  (__pyx_v_dims[1]) = __pyx_t_9;
6325  (__pyx_v_dims[2]) = __pyx_t_10;
6326 
6327  /* "freenect.pyx":475
6328  * if mode.video_format in (VIDEO_RGB, VIDEO_YUV_RGB):
6329  * dims[0], dims[1], dims[2] = mode.height, mode.width, 3
6330  * return PyArray_SimpleNewFromData(3, dims, npc.NPY_UINT8, data) # <<<<<<<<<<<<<<
6331  * elif mode.video_format == VIDEO_IR_8BIT:
6332  * dims[0], dims[1] = mode.height, mode.width
6333  */
6334  __Pyx_XDECREF(__pyx_r);
6335  __pyx_t_2 = PyArray_SimpleNewFromData(3, __pyx_v_dims, NPY_UINT8, __pyx_v_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6336  __Pyx_GOTREF(__pyx_t_2);
6337  __pyx_r = __pyx_t_2;
6338  __pyx_t_2 = 0;
6339  goto __pyx_L0;
6340  }
6341 
6342  /* "freenect.pyx":476
6343  * dims[0], dims[1], dims[2] = mode.height, mode.width, 3
6344  * return PyArray_SimpleNewFromData(3, dims, npc.NPY_UINT8, data)
6345  * elif mode.video_format == VIDEO_IR_8BIT: # <<<<<<<<<<<<<<
6346  * dims[0], dims[1] = mode.height, mode.width
6347  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT8, data)
6348  */
6349  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_mode->video_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6350  __Pyx_GOTREF(__pyx_t_2);
6351  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEO_IR_8BIT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6352  __Pyx_GOTREF(__pyx_t_3);
6353  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6354  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6355  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6356  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6357  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6358  if (__pyx_t_5) {
6359 
6360  /* "freenect.pyx":477
6361  * return PyArray_SimpleNewFromData(3, dims, npc.NPY_UINT8, data)
6362  * elif mode.video_format == VIDEO_IR_8BIT:
6363  * dims[0], dims[1] = mode.height, mode.width # <<<<<<<<<<<<<<
6364  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT8, data)
6365  * elif mode.video_format == VIDEO_IR_10BIT:
6366  */
6367  __pyx_t_9 = __pyx_v_mode->height;
6368  __pyx_t_8 = __pyx_v_mode->width;
6369  (__pyx_v_dims[0]) = __pyx_t_9;
6370  (__pyx_v_dims[1]) = __pyx_t_8;
6371 
6372  /* "freenect.pyx":478
6373  * elif mode.video_format == VIDEO_IR_8BIT:
6374  * dims[0], dims[1] = mode.height, mode.width
6375  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT8, data) # <<<<<<<<<<<<<<
6376  * elif mode.video_format == VIDEO_IR_10BIT:
6377  * dims[0], dims[1] = mode.height, mode.width
6378  */
6379  __Pyx_XDECREF(__pyx_r);
6380  __pyx_t_4 = PyArray_SimpleNewFromData(2, __pyx_v_dims, NPY_UINT8, __pyx_v_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6381  __Pyx_GOTREF(__pyx_t_4);
6382  __pyx_r = __pyx_t_4;
6383  __pyx_t_4 = 0;
6384  goto __pyx_L0;
6385  }
6386 
6387  /* "freenect.pyx":479
6388  * dims[0], dims[1] = mode.height, mode.width
6389  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT8, data)
6390  * elif mode.video_format == VIDEO_IR_10BIT: # <<<<<<<<<<<<<<
6391  * dims[0], dims[1] = mode.height, mode.width
6392  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data)
6393  */
6394  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_mode->video_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6395  __Pyx_GOTREF(__pyx_t_4);
6396  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEO_IR_10BIT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6397  __Pyx_GOTREF(__pyx_t_3);
6398  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6399  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6400  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6401  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6402  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6403  if (__pyx_t_5) {
6404 
6405  /* "freenect.pyx":480
6406  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT8, data)
6407  * elif mode.video_format == VIDEO_IR_10BIT:
6408  * dims[0], dims[1] = mode.height, mode.width # <<<<<<<<<<<<<<
6409  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data)
6410  * else:
6411  */
6412  __pyx_t_8 = __pyx_v_mode->height;
6413  __pyx_t_9 = __pyx_v_mode->width;
6414  (__pyx_v_dims[0]) = __pyx_t_8;
6415  (__pyx_v_dims[1]) = __pyx_t_9;
6416 
6417  /* "freenect.pyx":481
6418  * elif mode.video_format == VIDEO_IR_10BIT:
6419  * dims[0], dims[1] = mode.height, mode.width
6420  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data) # <<<<<<<<<<<<<<
6421  * else:
6422  * return (<char *>data)[:mode.bytes]
6423  */
6424  __Pyx_XDECREF(__pyx_r);
6425  __pyx_t_2 = PyArray_SimpleNewFromData(2, __pyx_v_dims, NPY_UINT16, __pyx_v_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6426  __Pyx_GOTREF(__pyx_t_2);
6427  __pyx_r = __pyx_t_2;
6428  __pyx_t_2 = 0;
6429  goto __pyx_L0;
6430  }
6431  /*else*/ {
6432 
6433  /* "freenect.pyx":483
6434  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data)
6435  * else:
6436  * return (<char *>data)[:mode.bytes] # <<<<<<<<<<<<<<
6437  *
6438  * def sync_get_depth(index=0, format=DEPTH_11BIT):
6439  */
6440  __Pyx_XDECREF(__pyx_r);
6441  __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_data) + 0, __pyx_v_mode->bytes - 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6442  __Pyx_GOTREF(__pyx_t_2);
6443  __pyx_r = __pyx_t_2;
6444  __pyx_t_2 = 0;
6445  goto __pyx_L0;
6446  }
6447 
6448  /* "freenect.pyx":470
6449  *
6450  *
6451  * cdef _video_cb_np(void *data, freenect_frame_mode *mode): # <<<<<<<<<<<<<<
6452  * cdef npc.npy_intp dims[3]
6453  *
6454  */
6455 
6456  /* function exit code */
6457  __pyx_L1_error:;
6458  __Pyx_XDECREF(__pyx_t_2);
6459  __Pyx_XDECREF(__pyx_t_3);
6460  __Pyx_XDECREF(__pyx_t_4);
6461  __Pyx_AddTraceback("freenect._video_cb_np", __pyx_clineno, __pyx_lineno, __pyx_filename);
6462  __pyx_r = 0;
6463  __pyx_L0:;
6464  __Pyx_XGIVEREF(__pyx_r);
6465  __Pyx_RefNannyFinishContext();
6466  return __pyx_r;
6467 }
6468 
6469 /* "freenect.pyx":485
6470  * return (<char *>data)[:mode.bytes]
6471  *
6472  * def sync_get_depth(index=0, format=DEPTH_11BIT): # <<<<<<<<<<<<<<
6473  * """Get the next available depth frame from the kinect, as a numpy array.
6474  *
6475  */
6476 
6477 /* Python wrapper */
6478 static PyObject *__pyx_pw_8freenect_53sync_get_depth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6479 static char __pyx_doc_8freenect_52sync_get_depth[] = "Get the next available depth frame from the kinect, as a numpy array.\n\n Args:\n index: Kinect device index (default: 0)\n format: Depth format (default: DEPTH_11BIT)\n\n Returns:\n (depth, timestamp) or None on error\n depth: A numpy array, shape:(640,480) dtype:np.uint16\n timestamp: int representing the time\n ";
6480 static PyMethodDef __pyx_mdef_8freenect_53sync_get_depth = {__Pyx_NAMESTR("sync_get_depth"), (PyCFunction)__pyx_pw_8freenect_53sync_get_depth, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8freenect_52sync_get_depth)};
6481 static PyObject *__pyx_pw_8freenect_53sync_get_depth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6482  PyObject *__pyx_v_index = 0;
6483  PyObject *__pyx_v_format = 0;
6484  int __pyx_lineno = 0;
6485  const char *__pyx_filename = NULL;
6486  int __pyx_clineno = 0;
6487  PyObject *__pyx_r = 0;
6488  __Pyx_RefNannyDeclarations
6489  __Pyx_RefNannySetupContext("sync_get_depth (wrapper)", 0);
6490  {
6491  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_format,0};
6492  PyObject* values[2] = {0,0};
6493  values[0] = ((PyObject *)__pyx_int_0);
6494  values[1] = __pyx_k__5;
6495  if (unlikely(__pyx_kwds)) {
6496  Py_ssize_t kw_args;
6497  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6498  switch (pos_args) {
6499  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6500  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6501  case 0: break;
6502  default: goto __pyx_L5_argtuple_error;
6503  }
6504  kw_args = PyDict_Size(__pyx_kwds);
6505  switch (pos_args) {
6506  case 0:
6507  if (kw_args > 0) {
6508  PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index);
6509  if (value) { values[0] = value; kw_args--; }
6510  }
6511  case 1:
6512  if (kw_args > 0) {
6513  PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format);
6514  if (value) { values[1] = value; kw_args--; }
6515  }
6516  }
6517  if (unlikely(kw_args > 0)) {
6518  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sync_get_depth") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6519  }
6520  } else {
6521  switch (PyTuple_GET_SIZE(__pyx_args)) {
6522  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6523  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6524  case 0: break;
6525  default: goto __pyx_L5_argtuple_error;
6526  }
6527  }
6528  __pyx_v_index = values[0];
6529  __pyx_v_format = values[1];
6530  }
6531  goto __pyx_L4_argument_unpacking_done;
6532  __pyx_L5_argtuple_error:;
6533  __Pyx_RaiseArgtupleInvalid("sync_get_depth", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6534  __pyx_L3_error:;
6535  __Pyx_AddTraceback("freenect.sync_get_depth", __pyx_clineno, __pyx_lineno, __pyx_filename);
6536  __Pyx_RefNannyFinishContext();
6537  return NULL;
6538  __pyx_L4_argument_unpacking_done:;
6539  __pyx_r = __pyx_pf_8freenect_52sync_get_depth(__pyx_self, __pyx_v_index, __pyx_v_format);
6540 
6541  /* function exit code */
6542  __Pyx_RefNannyFinishContext();
6543  return __pyx_r;
6544 }
6545 
6546 static PyObject *__pyx_pf_8freenect_52sync_get_depth(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index, PyObject *__pyx_v_format) {
6547  void *__pyx_v_data;
6548  uint32_t __pyx_v_timestamp;
6549  npy_intp __pyx_v_dims[2];
6550  int __pyx_v_out;
6551  int __pyx_v__index;
6552  freenect_depth_format __pyx_v__format;
6553  PyObject *__pyx_r = NULL;
6554  __Pyx_RefNannyDeclarations
6555  int __pyx_t_1;
6556  freenect_depth_format __pyx_t_2;
6557  int __pyx_t_3;
6558  PyObject *__pyx_t_4 = NULL;
6559  PyObject *__pyx_t_5 = NULL;
6560  PyObject *__pyx_t_6 = NULL;
6561  int __pyx_t_7;
6562  int __pyx_t_8;
6563  npy_intp __pyx_t_9;
6564  npy_intp __pyx_t_10;
6565  int __pyx_lineno = 0;
6566  const char *__pyx_filename = NULL;
6567  int __pyx_clineno = 0;
6568  __Pyx_RefNannySetupContext("sync_get_depth", 0);
6569 
6570  /* "freenect.pyx":501
6571  * cdef npc.npy_intp dims[2]
6572  * cdef int out
6573  * cdef int _index = index # <<<<<<<<<<<<<<
6574  * cdef freenect_depth_format _format = format
6575  * with nogil:
6576  */
6577  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6578  __pyx_v__index = __pyx_t_1;
6579 
6580  /* "freenect.pyx":502
6581  * cdef int out
6582  * cdef int _index = index
6583  * cdef freenect_depth_format _format = format # <<<<<<<<<<<<<<
6584  * with nogil:
6585  * out = freenect_sync_get_depth(&data, &timestamp, _index, _format)
6586  */
6587  __pyx_t_2 = ((freenect_depth_format)PyInt_AsLong(__pyx_v_format)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6588  __pyx_v__format = __pyx_t_2;
6589 
6590  /* "freenect.pyx":503
6591  * cdef int _index = index
6592  * cdef freenect_depth_format _format = format
6593  * with nogil: # <<<<<<<<<<<<<<
6594  * out = freenect_sync_get_depth(&data, &timestamp, _index, _format)
6595  * if out:
6596  */
6597  {
6598  #ifdef WITH_THREAD
6599  PyThreadState *_save;
6600  Py_UNBLOCK_THREADS
6601  #endif
6602  /*try:*/ {
6603 
6604  /* "freenect.pyx":504
6605  * cdef freenect_depth_format _format = format
6606  * with nogil:
6607  * out = freenect_sync_get_depth(&data, &timestamp, _index, _format) # <<<<<<<<<<<<<<
6608  * if out:
6609  * error_open_device()
6610  */
6611  __pyx_v_out = freenect_sync_get_depth((&__pyx_v_data), (&__pyx_v_timestamp), __pyx_v__index, __pyx_v__format);
6612  }
6613 
6614  /* "freenect.pyx":503
6615  * cdef int _index = index
6616  * cdef freenect_depth_format _format = format
6617  * with nogil: # <<<<<<<<<<<<<<
6618  * out = freenect_sync_get_depth(&data, &timestamp, _index, _format)
6619  * if out:
6620  */
6621  /*finally:*/ {
6622  /*normal exit:*/{
6623  #ifdef WITH_THREAD
6624  Py_BLOCK_THREADS
6625  #endif
6626  goto __pyx_L5;
6627  }
6628  __pyx_L5:;
6629  }
6630  }
6631 
6632  /* "freenect.pyx":505
6633  * with nogil:
6634  * out = freenect_sync_get_depth(&data, &timestamp, _index, _format)
6635  * if out: # <<<<<<<<<<<<<<
6636  * error_open_device()
6637  * return
6638  */
6639  __pyx_t_3 = (__pyx_v_out != 0);
6640  if (__pyx_t_3) {
6641 
6642  /* "freenect.pyx":506
6643  * out = freenect_sync_get_depth(&data, &timestamp, _index, _format)
6644  * if out:
6645  * error_open_device() # <<<<<<<<<<<<<<
6646  * return
6647  * if format in [DEPTH_11BIT, DEPTH_10BIT, DEPTH_MM, DEPTH_REGISTERED]:
6648  */
6649  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error_open_device); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6650  __Pyx_GOTREF(__pyx_t_4);
6651  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6652  __Pyx_GOTREF(__pyx_t_5);
6653  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6654  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6655 
6656  /* "freenect.pyx":507
6657  * if out:
6658  * error_open_device()
6659  * return # <<<<<<<<<<<<<<
6660  * if format in [DEPTH_11BIT, DEPTH_10BIT, DEPTH_MM, DEPTH_REGISTERED]:
6661  * dims[0], dims[1] = 480, 640
6662  */
6663  __Pyx_XDECREF(__pyx_r);
6664  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6665  goto __pyx_L0;
6666  }
6667 
6668  /* "freenect.pyx":508
6669  * error_open_device()
6670  * return
6671  * if format in [DEPTH_11BIT, DEPTH_10BIT, DEPTH_MM, DEPTH_REGISTERED]: # <<<<<<<<<<<<<<
6672  * dims[0], dims[1] = 480, 640
6673  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data), timestamp
6674  */
6675  __Pyx_INCREF(__pyx_v_format);
6676  __pyx_t_5 = __pyx_v_format;
6677  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEPTH_11BIT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6678  __Pyx_GOTREF(__pyx_t_4);
6679  __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6680  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6681  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6682  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6683  if (!__pyx_t_3) {
6684  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEPTH_10BIT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6685  __Pyx_GOTREF(__pyx_t_6);
6686  __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6687  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6688  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6689  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6690  __pyx_t_8 = __pyx_t_7;
6691  } else {
6692  __pyx_t_8 = __pyx_t_3;
6693  }
6694  if (!__pyx_t_8) {
6695  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEPTH_MM); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6696  __Pyx_GOTREF(__pyx_t_4);
6697  __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6698  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6699  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6700  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6701  __pyx_t_7 = __pyx_t_3;
6702  } else {
6703  __pyx_t_7 = __pyx_t_8;
6704  }
6705  if (!__pyx_t_7) {
6706  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEPTH_REGISTERED); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6707  __Pyx_GOTREF(__pyx_t_6);
6708  __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6709  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6710  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6711  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6712  __pyx_t_3 = __pyx_t_8;
6713  } else {
6714  __pyx_t_3 = __pyx_t_7;
6715  }
6716  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6717  __pyx_t_7 = (__pyx_t_3 != 0);
6718  if (__pyx_t_7) {
6719 
6720  /* "freenect.pyx":509
6721  * return
6722  * if format in [DEPTH_11BIT, DEPTH_10BIT, DEPTH_MM, DEPTH_REGISTERED]:
6723  * dims[0], dims[1] = 480, 640 # <<<<<<<<<<<<<<
6724  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data), timestamp
6725  * else:
6726  */
6727  __pyx_t_9 = 480;
6728  __pyx_t_10 = 640;
6729  (__pyx_v_dims[0]) = __pyx_t_9;
6730  (__pyx_v_dims[1]) = __pyx_t_10;
6731 
6732  /* "freenect.pyx":510
6733  * if format in [DEPTH_11BIT, DEPTH_10BIT, DEPTH_MM, DEPTH_REGISTERED]:
6734  * dims[0], dims[1] = 480, 640
6735  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data), timestamp # <<<<<<<<<<<<<<
6736  * else:
6737  * raise TypeError('Conversion not implemented for type [%d]' % (format))
6738  */
6739  __Pyx_XDECREF(__pyx_r);
6740  __pyx_t_5 = PyArray_SimpleNewFromData(2, __pyx_v_dims, NPY_UINT16, __pyx_v_data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6741  __Pyx_GOTREF(__pyx_t_5);
6742  __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_timestamp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6743  __Pyx_GOTREF(__pyx_t_4);
6744  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6745  __Pyx_GOTREF(__pyx_t_6);
6746  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
6747  __Pyx_GIVEREF(__pyx_t_5);
6748  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
6749  __Pyx_GIVEREF(__pyx_t_4);
6750  __pyx_t_5 = 0;
6751  __pyx_t_4 = 0;
6752  __pyx_r = __pyx_t_6;
6753  __pyx_t_6 = 0;
6754  goto __pyx_L0;
6755  }
6756  /*else*/ {
6757 
6758  /* "freenect.pyx":512
6759  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data), timestamp
6760  * else:
6761  * raise TypeError('Conversion not implemented for type [%d]' % (format)) # <<<<<<<<<<<<<<
6762  *
6763  *
6764  */
6765  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Conversion_not_implemented_for_t, __pyx_v_format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6766  __Pyx_GOTREF(__pyx_t_6);
6767  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6768  __Pyx_GOTREF(__pyx_t_4);
6769  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
6770  __Pyx_GIVEREF(__pyx_t_6);
6771  __pyx_t_6 = 0;
6772  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6773  __Pyx_GOTREF(__pyx_t_6);
6774  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6775  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
6776  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6777  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6778  }
6779 
6780  /* "freenect.pyx":485
6781  * return (<char *>data)[:mode.bytes]
6782  *
6783  * def sync_get_depth(index=0, format=DEPTH_11BIT): # <<<<<<<<<<<<<<
6784  * """Get the next available depth frame from the kinect, as a numpy array.
6785  *
6786  */
6787 
6788  /* function exit code */
6789  __pyx_L1_error:;
6790  __Pyx_XDECREF(__pyx_t_4);
6791  __Pyx_XDECREF(__pyx_t_5);
6792  __Pyx_XDECREF(__pyx_t_6);
6793  __Pyx_AddTraceback("freenect.sync_get_depth", __pyx_clineno, __pyx_lineno, __pyx_filename);
6794  __pyx_r = NULL;
6795  __pyx_L0:;
6796  __Pyx_XGIVEREF(__pyx_r);
6797  __Pyx_RefNannyFinishContext();
6798  return __pyx_r;
6799 }
6800 
6801 /* "freenect.pyx":515
6802  *
6803  *
6804  * def sync_get_video(index=0, format=VIDEO_RGB): # <<<<<<<<<<<<<<
6805  * """Get the next available rgb frame from the kinect, as a numpy array.
6806  *
6807  */
6808 
6809 /* Python wrapper */
6810 static PyObject *__pyx_pw_8freenect_55sync_get_video(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6811 static char __pyx_doc_8freenect_54sync_get_video[] = "Get the next available rgb frame from the kinect, as a numpy array.\n\n Args:\n index: Kinect device index (default: 0)\n format: Depth format (default: VIDEO_RGB)\n\n Returns:\n (depth, timestamp) or None on error\n depth: A numpy array, shape:(480, 640, 3) dtype:np.uint8\n timestamp: int representing the time\n ";
6812 static PyMethodDef __pyx_mdef_8freenect_55sync_get_video = {__Pyx_NAMESTR("sync_get_video"), (PyCFunction)__pyx_pw_8freenect_55sync_get_video, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8freenect_54sync_get_video)};
6813 static PyObject *__pyx_pw_8freenect_55sync_get_video(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6814  PyObject *__pyx_v_index = 0;
6815  PyObject *__pyx_v_format = 0;
6816  int __pyx_lineno = 0;
6817  const char *__pyx_filename = NULL;
6818  int __pyx_clineno = 0;
6819  PyObject *__pyx_r = 0;
6820  __Pyx_RefNannyDeclarations
6821  __Pyx_RefNannySetupContext("sync_get_video (wrapper)", 0);
6822  {
6823  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_format,0};
6824  PyObject* values[2] = {0,0};
6825  values[0] = ((PyObject *)__pyx_int_0);
6826  values[1] = __pyx_k__6;
6827  if (unlikely(__pyx_kwds)) {
6828  Py_ssize_t kw_args;
6829  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6830  switch (pos_args) {
6831  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6832  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6833  case 0: break;
6834  default: goto __pyx_L5_argtuple_error;
6835  }
6836  kw_args = PyDict_Size(__pyx_kwds);
6837  switch (pos_args) {
6838  case 0:
6839  if (kw_args > 0) {
6840  PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index);
6841  if (value) { values[0] = value; kw_args--; }
6842  }
6843  case 1:
6844  if (kw_args > 0) {
6845  PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format);
6846  if (value) { values[1] = value; kw_args--; }
6847  }
6848  }
6849  if (unlikely(kw_args > 0)) {
6850  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sync_get_video") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6851  }
6852  } else {
6853  switch (PyTuple_GET_SIZE(__pyx_args)) {
6854  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6855  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6856  case 0: break;
6857  default: goto __pyx_L5_argtuple_error;
6858  }
6859  }
6860  __pyx_v_index = values[0];
6861  __pyx_v_format = values[1];
6862  }
6863  goto __pyx_L4_argument_unpacking_done;
6864  __pyx_L5_argtuple_error:;
6865  __Pyx_RaiseArgtupleInvalid("sync_get_video", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6866  __pyx_L3_error:;
6867  __Pyx_AddTraceback("freenect.sync_get_video", __pyx_clineno, __pyx_lineno, __pyx_filename);
6868  __Pyx_RefNannyFinishContext();
6869  return NULL;
6870  __pyx_L4_argument_unpacking_done:;
6871  __pyx_r = __pyx_pf_8freenect_54sync_get_video(__pyx_self, __pyx_v_index, __pyx_v_format);
6872 
6873  /* function exit code */
6874  __Pyx_RefNannyFinishContext();
6875  return __pyx_r;
6876 }
6877 
6878 static PyObject *__pyx_pf_8freenect_54sync_get_video(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index, PyObject *__pyx_v_format) {
6879  void *__pyx_v_data;
6880  uint32_t __pyx_v_timestamp;
6881  npy_intp __pyx_v_dims[3];
6882  int __pyx_v_out;
6883  int __pyx_v__index;
6884  freenect_video_format __pyx_v__format;
6885  PyObject *__pyx_r = NULL;
6886  __Pyx_RefNannyDeclarations
6887  int __pyx_t_1;
6888  freenect_video_format __pyx_t_2;
6889  int __pyx_t_3;
6890  PyObject *__pyx_t_4 = NULL;
6891  PyObject *__pyx_t_5 = NULL;
6892  npy_intp __pyx_t_6;
6893  npy_intp __pyx_t_7;
6894  npy_intp __pyx_t_8;
6895  PyObject *__pyx_t_9 = NULL;
6896  int __pyx_lineno = 0;
6897  const char *__pyx_filename = NULL;
6898  int __pyx_clineno = 0;
6899  __Pyx_RefNannySetupContext("sync_get_video", 0);
6900 
6901  /* "freenect.pyx":531
6902  * cdef npc.npy_intp dims[3]
6903  * cdef int out
6904  * cdef int _index = index # <<<<<<<<<<<<<<
6905  * cdef freenect_video_format _format = format
6906  * with nogil:
6907  */
6908  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6909  __pyx_v__index = __pyx_t_1;
6910 
6911  /* "freenect.pyx":532
6912  * cdef int out
6913  * cdef int _index = index
6914  * cdef freenect_video_format _format = format # <<<<<<<<<<<<<<
6915  * with nogil:
6916  * out = freenect_sync_get_video(&data, &timestamp, _index, _format)
6917  */
6918  __pyx_t_2 = ((freenect_video_format)PyInt_AsLong(__pyx_v_format)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6919  __pyx_v__format = __pyx_t_2;
6920 
6921  /* "freenect.pyx":533
6922  * cdef int _index = index
6923  * cdef freenect_video_format _format = format
6924  * with nogil: # <<<<<<<<<<<<<<
6925  * out = freenect_sync_get_video(&data, &timestamp, _index, _format)
6926  * if out:
6927  */
6928  {
6929  #ifdef WITH_THREAD
6930  PyThreadState *_save;
6931  Py_UNBLOCK_THREADS
6932  #endif
6933  /*try:*/ {
6934 
6935  /* "freenect.pyx":534
6936  * cdef freenect_video_format _format = format
6937  * with nogil:
6938  * out = freenect_sync_get_video(&data, &timestamp, _index, _format) # <<<<<<<<<<<<<<
6939  * if out:
6940  * error_open_device()
6941  */
6942  __pyx_v_out = freenect_sync_get_video((&__pyx_v_data), (&__pyx_v_timestamp), __pyx_v__index, __pyx_v__format);
6943  }
6944 
6945  /* "freenect.pyx":533
6946  * cdef int _index = index
6947  * cdef freenect_video_format _format = format
6948  * with nogil: # <<<<<<<<<<<<<<
6949  * out = freenect_sync_get_video(&data, &timestamp, _index, _format)
6950  * if out:
6951  */
6952  /*finally:*/ {
6953  /*normal exit:*/{
6954  #ifdef WITH_THREAD
6955  Py_BLOCK_THREADS
6956  #endif
6957  goto __pyx_L5;
6958  }
6959  __pyx_L5:;
6960  }
6961  }
6962 
6963  /* "freenect.pyx":535
6964  * with nogil:
6965  * out = freenect_sync_get_video(&data, &timestamp, _index, _format)
6966  * if out: # <<<<<<<<<<<<<<
6967  * error_open_device()
6968  * return
6969  */
6970  __pyx_t_3 = (__pyx_v_out != 0);
6971  if (__pyx_t_3) {
6972 
6973  /* "freenect.pyx":536
6974  * out = freenect_sync_get_video(&data, &timestamp, _index, _format)
6975  * if out:
6976  * error_open_device() # <<<<<<<<<<<<<<
6977  * return
6978  * if format == VIDEO_RGB:
6979  */
6980  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error_open_device); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6981  __Pyx_GOTREF(__pyx_t_4);
6982  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6983  __Pyx_GOTREF(__pyx_t_5);
6984  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6985  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6986 
6987  /* "freenect.pyx":537
6988  * if out:
6989  * error_open_device()
6990  * return # <<<<<<<<<<<<<<
6991  * if format == VIDEO_RGB:
6992  * dims[0], dims[1], dims[2] = 480, 640, 3
6993  */
6994  __Pyx_XDECREF(__pyx_r);
6995  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6996  goto __pyx_L0;
6997  }
6998 
6999  /* "freenect.pyx":538
7000  * error_open_device()
7001  * return
7002  * if format == VIDEO_RGB: # <<<<<<<<<<<<<<
7003  * dims[0], dims[1], dims[2] = 480, 640, 3
7004  * return PyArray_SimpleNewFromData(3, dims, npc.NPY_UINT8, data), timestamp
7005  */
7006  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEO_RGB); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7007  __Pyx_GOTREF(__pyx_t_5);
7008  __pyx_t_4 = PyObject_RichCompare(__pyx_v_format, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7009  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7010  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7011  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7012  if (__pyx_t_3) {
7013 
7014  /* "freenect.pyx":539
7015  * return
7016  * if format == VIDEO_RGB:
7017  * dims[0], dims[1], dims[2] = 480, 640, 3 # <<<<<<<<<<<<<<
7018  * return PyArray_SimpleNewFromData(3, dims, npc.NPY_UINT8, data), timestamp
7019  * elif format == VIDEO_IR_8BIT:
7020  */
7021  __pyx_t_6 = 480;
7022  __pyx_t_7 = 640;
7023  __pyx_t_8 = 3;
7024  (__pyx_v_dims[0]) = __pyx_t_6;
7025  (__pyx_v_dims[1]) = __pyx_t_7;
7026  (__pyx_v_dims[2]) = __pyx_t_8;
7027 
7028  /* "freenect.pyx":540
7029  * if format == VIDEO_RGB:
7030  * dims[0], dims[1], dims[2] = 480, 640, 3
7031  * return PyArray_SimpleNewFromData(3, dims, npc.NPY_UINT8, data), timestamp # <<<<<<<<<<<<<<
7032  * elif format == VIDEO_IR_8BIT:
7033  * dims[0], dims[1] = 480, 640
7034  */
7035  __Pyx_XDECREF(__pyx_r);
7036  __pyx_t_4 = PyArray_SimpleNewFromData(3, __pyx_v_dims, NPY_UINT8, __pyx_v_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7037  __Pyx_GOTREF(__pyx_t_4);
7038  __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_timestamp); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7039  __Pyx_GOTREF(__pyx_t_5);
7040  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7041  __Pyx_GOTREF(__pyx_t_9);
7042  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4);
7043  __Pyx_GIVEREF(__pyx_t_4);
7044  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5);
7045  __Pyx_GIVEREF(__pyx_t_5);
7046  __pyx_t_4 = 0;
7047  __pyx_t_5 = 0;
7048  __pyx_r = __pyx_t_9;
7049  __pyx_t_9 = 0;
7050  goto __pyx_L0;
7051  }
7052 
7053  /* "freenect.pyx":541
7054  * dims[0], dims[1], dims[2] = 480, 640, 3
7055  * return PyArray_SimpleNewFromData(3, dims, npc.NPY_UINT8, data), timestamp
7056  * elif format == VIDEO_IR_8BIT: # <<<<<<<<<<<<<<
7057  * dims[0], dims[1] = 480, 640
7058  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT8, data), timestamp
7059  */
7060  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEO_IR_8BIT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7061  __Pyx_GOTREF(__pyx_t_9);
7062  __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7063  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7064  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7065  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7066  if (__pyx_t_3) {
7067 
7068  /* "freenect.pyx":542
7069  * return PyArray_SimpleNewFromData(3, dims, npc.NPY_UINT8, data), timestamp
7070  * elif format == VIDEO_IR_8BIT:
7071  * dims[0], dims[1] = 480, 640 # <<<<<<<<<<<<<<
7072  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT8, data), timestamp
7073  * elif format == VIDEO_IR_10BIT:
7074  */
7075  __pyx_t_8 = 480;
7076  __pyx_t_7 = 640;
7077  (__pyx_v_dims[0]) = __pyx_t_8;
7078  (__pyx_v_dims[1]) = __pyx_t_7;
7079 
7080  /* "freenect.pyx":543
7081  * elif format == VIDEO_IR_8BIT:
7082  * dims[0], dims[1] = 480, 640
7083  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT8, data), timestamp # <<<<<<<<<<<<<<
7084  * elif format == VIDEO_IR_10BIT:
7085  * dims[0], dims[1] = 480, 640
7086  */
7087  __Pyx_XDECREF(__pyx_r);
7088  __pyx_t_5 = PyArray_SimpleNewFromData(2, __pyx_v_dims, NPY_UINT8, __pyx_v_data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7089  __Pyx_GOTREF(__pyx_t_5);
7090  __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_timestamp); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7091  __Pyx_GOTREF(__pyx_t_9);
7092  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7093  __Pyx_GOTREF(__pyx_t_4);
7094  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
7095  __Pyx_GIVEREF(__pyx_t_5);
7096  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_9);
7097  __Pyx_GIVEREF(__pyx_t_9);
7098  __pyx_t_5 = 0;
7099  __pyx_t_9 = 0;
7100  __pyx_r = __pyx_t_4;
7101  __pyx_t_4 = 0;
7102  goto __pyx_L0;
7103  }
7104 
7105  /* "freenect.pyx":544
7106  * dims[0], dims[1] = 480, 640
7107  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT8, data), timestamp
7108  * elif format == VIDEO_IR_10BIT: # <<<<<<<<<<<<<<
7109  * dims[0], dims[1] = 480, 640
7110  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data), timestamp
7111  */
7112  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEO_IR_10BIT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7113  __Pyx_GOTREF(__pyx_t_4);
7114  __pyx_t_9 = PyObject_RichCompare(__pyx_v_format, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7115  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7116  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7117  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7118  if (__pyx_t_3) {
7119 
7120  /* "freenect.pyx":545
7121  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT8, data), timestamp
7122  * elif format == VIDEO_IR_10BIT:
7123  * dims[0], dims[1] = 480, 640 # <<<<<<<<<<<<<<
7124  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data), timestamp
7125  * else:
7126  */
7127  __pyx_t_7 = 480;
7128  __pyx_t_8 = 640;
7129  (__pyx_v_dims[0]) = __pyx_t_7;
7130  (__pyx_v_dims[1]) = __pyx_t_8;
7131 
7132  /* "freenect.pyx":546
7133  * elif format == VIDEO_IR_10BIT:
7134  * dims[0], dims[1] = 480, 640
7135  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data), timestamp # <<<<<<<<<<<<<<
7136  * else:
7137  * raise TypeError('Conversion not implemented for type [%d]' % (format))
7138  */
7139  __Pyx_XDECREF(__pyx_r);
7140  __pyx_t_9 = PyArray_SimpleNewFromData(2, __pyx_v_dims, NPY_UINT16, __pyx_v_data); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7141  __Pyx_GOTREF(__pyx_t_9);
7142  __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_timestamp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7143  __Pyx_GOTREF(__pyx_t_4);
7144  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7145  __Pyx_GOTREF(__pyx_t_5);
7146  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9);
7147  __Pyx_GIVEREF(__pyx_t_9);
7148  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
7149  __Pyx_GIVEREF(__pyx_t_4);
7150  __pyx_t_9 = 0;
7151  __pyx_t_4 = 0;
7152  __pyx_r = __pyx_t_5;
7153  __pyx_t_5 = 0;
7154  goto __pyx_L0;
7155  }
7156  /*else*/ {
7157 
7158  /* "freenect.pyx":548
7159  * return PyArray_SimpleNewFromData(2, dims, npc.NPY_UINT16, data), timestamp
7160  * else:
7161  * raise TypeError('Conversion not implemented for type [%d]' % (format)) # <<<<<<<<<<<<<<
7162  *
7163  *
7164  */
7165  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Conversion_not_implemented_for_t, __pyx_v_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7166  __Pyx_GOTREF(__pyx_t_5);
7167  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7168  __Pyx_GOTREF(__pyx_t_4);
7169  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
7170  __Pyx_GIVEREF(__pyx_t_5);
7171  __pyx_t_5 = 0;
7172  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7173  __Pyx_GOTREF(__pyx_t_5);
7174  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7175  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
7176  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7177  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7178  }
7179 
7180  /* "freenect.pyx":515
7181  *
7182  *
7183  * def sync_get_video(index=0, format=VIDEO_RGB): # <<<<<<<<<<<<<<
7184  * """Get the next available rgb frame from the kinect, as a numpy array.
7185  *
7186  */
7187 
7188  /* function exit code */
7189  __pyx_L1_error:;
7190  __Pyx_XDECREF(__pyx_t_4);
7191  __Pyx_XDECREF(__pyx_t_5);
7192  __Pyx_XDECREF(__pyx_t_9);
7193  __Pyx_AddTraceback("freenect.sync_get_video", __pyx_clineno, __pyx_lineno, __pyx_filename);
7194  __pyx_r = NULL;
7195  __pyx_L0:;
7196  __Pyx_XGIVEREF(__pyx_r);
7197  __Pyx_RefNannyFinishContext();
7198  return __pyx_r;
7199 }
7200 
7201 /* "freenect.pyx":551
7202  *
7203  *
7204  * def sync_stop(): # <<<<<<<<<<<<<<
7205  * """Terminate the synchronous runloop if running, else this is a NOP
7206  * """
7207  */
7208 
7209 /* Python wrapper */
7210 static PyObject *__pyx_pw_8freenect_57sync_stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7211 static char __pyx_doc_8freenect_56sync_stop[] = "Terminate the synchronous runloop if running, else this is a NOP\n ";
7212 static PyMethodDef __pyx_mdef_8freenect_57sync_stop = {__Pyx_NAMESTR("sync_stop"), (PyCFunction)__pyx_pw_8freenect_57sync_stop, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_8freenect_56sync_stop)};
7213 static PyObject *__pyx_pw_8freenect_57sync_stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
7214  PyObject *__pyx_r = 0;
7215  __Pyx_RefNannyDeclarations
7216  __Pyx_RefNannySetupContext("sync_stop (wrapper)", 0);
7217  __pyx_r = __pyx_pf_8freenect_56sync_stop(__pyx_self);
7218 
7219  /* function exit code */
7220  __Pyx_RefNannyFinishContext();
7221  return __pyx_r;
7222 }
7223 
7224 static PyObject *__pyx_pf_8freenect_56sync_stop(CYTHON_UNUSED PyObject *__pyx_self) {
7225  PyObject *__pyx_r = NULL;
7226  __Pyx_RefNannyDeclarations
7227  __Pyx_RefNannySetupContext("sync_stop", 0);
7228 
7229  /* "freenect.pyx":554
7230  * """Terminate the synchronous runloop if running, else this is a NOP
7231  * """
7232  * freenect_sync_stop() # <<<<<<<<<<<<<<
7233  */
7235 
7236  /* "freenect.pyx":551
7237  *
7238  *
7239  * def sync_stop(): # <<<<<<<<<<<<<<
7240  * """Terminate the synchronous runloop if running, else this is a NOP
7241  * """
7242  */
7243 
7244  /* function exit code */
7245  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7246  __Pyx_XGIVEREF(__pyx_r);
7247  __Pyx_RefNannyFinishContext();
7248  return __pyx_r;
7249 }
7250 
7251 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
7252  * # experimental exception made for __getbuffer__ and __releasebuffer__
7253  * # -- the details of this may change.
7254  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
7255  * # This implementation of getbuffer is geared towards Cython
7256  * # requirements, and does not yet fullfill the PEP.
7257  */
7258 
7259 /* Python wrapper */
7260 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
7261 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
7262  int __pyx_r;
7263  __Pyx_RefNannyDeclarations
7264  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
7265  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
7266 
7267  /* function exit code */
7268  __Pyx_RefNannyFinishContext();
7269  return __pyx_r;
7270 }
7271 
7272 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
7273  int __pyx_v_copy_shape;
7274  int __pyx_v_i;
7275  int __pyx_v_ndim;
7276  int __pyx_v_endian_detector;
7277  int __pyx_v_little_endian;
7278  int __pyx_v_t;
7279  char *__pyx_v_f;
7280  PyArray_Descr *__pyx_v_descr = 0;
7281  int __pyx_v_offset;
7282  int __pyx_v_hasfields;
7283  int __pyx_r;
7284  __Pyx_RefNannyDeclarations
7285  int __pyx_t_1;
7286  int __pyx_t_2;
7287  int __pyx_t_3;
7288  PyObject *__pyx_t_4 = NULL;
7289  int __pyx_t_5;
7290  int __pyx_t_6;
7291  int __pyx_t_7;
7292  PyObject *__pyx_t_8 = NULL;
7293  char *__pyx_t_9;
7294  int __pyx_lineno = 0;
7295  const char *__pyx_filename = NULL;
7296  int __pyx_clineno = 0;
7297  __Pyx_RefNannySetupContext("__getbuffer__", 0);
7298  if (__pyx_v_info != NULL) {
7299  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
7300  __Pyx_GIVEREF(__pyx_v_info->obj);
7301  }
7302 
7303  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":200
7304  * # of flags
7305  *
7306  * if info == NULL: return # <<<<<<<<<<<<<<
7307  *
7308  * cdef int copy_shape, i, ndim
7309  */
7310  __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
7311  if (__pyx_t_1) {
7312  __pyx_r = 0;
7313  goto __pyx_L0;
7314  }
7315 
7316  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":203
7317  *
7318  * cdef int copy_shape, i, ndim
7319  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
7320  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
7321  *
7322  */
7323  __pyx_v_endian_detector = 1;
7324 
7325  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":204
7326  * cdef int copy_shape, i, ndim
7327  * cdef int endian_detector = 1
7328  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
7329  *
7330  * ndim = PyArray_NDIM(self)
7331  */
7332  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
7333 
7334  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":206
7335  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
7336  *
7337  * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
7338  *
7339  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7340  */
7341  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
7342 
7343  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":208
7344  * ndim = PyArray_NDIM(self)
7345  *
7346  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
7347  * copy_shape = 1
7348  * else:
7349  */
7350  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
7351  if (__pyx_t_1) {
7352 
7353  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":209
7354  *
7355  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
7356  * copy_shape = 1 # <<<<<<<<<<<<<<
7357  * else:
7358  * copy_shape = 0
7359  */
7360  __pyx_v_copy_shape = 1;
7361  goto __pyx_L4;
7362  }
7363  /*else*/ {
7364 
7365  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":211
7366  * copy_shape = 1
7367  * else:
7368  * copy_shape = 0 # <<<<<<<<<<<<<<
7369  *
7370  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
7371  */
7372  __pyx_v_copy_shape = 0;
7373  }
7374  __pyx_L4:;
7375 
7376  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":213
7377  * copy_shape = 0
7378  *
7379  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
7380  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
7381  * raise ValueError(u"ndarray is not C contiguous")
7382  */
7383  __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
7384  if (__pyx_t_1) {
7385 
7386  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":214
7387  *
7388  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
7389  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
7390  * raise ValueError(u"ndarray is not C contiguous")
7391  *
7392  */
7393  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
7394  __pyx_t_3 = __pyx_t_2;
7395  } else {
7396  __pyx_t_3 = __pyx_t_1;
7397  }
7398  if (__pyx_t_3) {
7399 
7400  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
7401  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
7402  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
7403  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
7404  *
7405  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
7406  */
7407  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7408  __Pyx_GOTREF(__pyx_t_4);
7409  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7410  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7411  {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7412  }
7413 
7414  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":217
7415  * raise ValueError(u"ndarray is not C contiguous")
7416  *
7417  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
7418  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
7419  * raise ValueError(u"ndarray is not Fortran contiguous")
7420  */
7421  __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
7422  if (__pyx_t_3) {
7423 
7424  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":218
7425  *
7426  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
7427  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
7428  * raise ValueError(u"ndarray is not Fortran contiguous")
7429  *
7430  */
7431  __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
7432  __pyx_t_2 = __pyx_t_1;
7433  } else {
7434  __pyx_t_2 = __pyx_t_3;
7435  }
7436  if (__pyx_t_2) {
7437 
7438  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219
7439  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
7440  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
7441  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
7442  *
7443  * info.buf = PyArray_DATA(self)
7444  */
7445  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7446  __Pyx_GOTREF(__pyx_t_4);
7447  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7448  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7449  {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7450  }
7451 
7452  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":221
7453  * raise ValueError(u"ndarray is not Fortran contiguous")
7454  *
7455  * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
7456  * info.ndim = ndim
7457  * if copy_shape:
7458  */
7459  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
7460 
7461  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
7462  *
7463  * info.buf = PyArray_DATA(self)
7464  * info.ndim = ndim # <<<<<<<<<<<<<<
7465  * if copy_shape:
7466  * # Allocate new buffer for strides and shape info.
7467  */
7468  __pyx_v_info->ndim = __pyx_v_ndim;
7469 
7470  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223
7471  * info.buf = PyArray_DATA(self)
7472  * info.ndim = ndim
7473  * if copy_shape: # <<<<<<<<<<<<<<
7474  * # Allocate new buffer for strides and shape info.
7475  * # This is allocated as one block, strides first.
7476  */
7477  __pyx_t_2 = (__pyx_v_copy_shape != 0);
7478  if (__pyx_t_2) {
7479 
7480  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":226
7481  * # Allocate new buffer for strides and shape info.
7482  * # This is allocated as one block, strides first.
7483  * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2) # <<<<<<<<<<<<<<
7484  * info.shape = info.strides + ndim
7485  * for i in range(ndim):
7486  */
7487  __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
7488 
7489  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
7490  * # This is allocated as one block, strides first.
7491  * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
7492  * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
7493  * for i in range(ndim):
7494  * info.strides[i] = PyArray_STRIDES(self)[i]
7495  */
7496  __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
7497 
7498  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228
7499  * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
7500  * info.shape = info.strides + ndim
7501  * for i in range(ndim): # <<<<<<<<<<<<<<
7502  * info.strides[i] = PyArray_STRIDES(self)[i]
7503  * info.shape[i] = PyArray_DIMS(self)[i]
7504  */
7505  __pyx_t_5 = __pyx_v_ndim;
7506  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
7507  __pyx_v_i = __pyx_t_6;
7508 
7509  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
7510  * info.shape = info.strides + ndim
7511  * for i in range(ndim):
7512  * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
7513  * info.shape[i] = PyArray_DIMS(self)[i]
7514  * else:
7515  */
7516  (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
7517 
7518  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":230
7519  * for i in range(ndim):
7520  * info.strides[i] = PyArray_STRIDES(self)[i]
7521  * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
7522  * else:
7523  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
7524  */
7525  (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
7526  }
7527  goto __pyx_L7;
7528  }
7529  /*else*/ {
7530 
7531  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
7532  * info.shape[i] = PyArray_DIMS(self)[i]
7533  * else:
7534  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
7535  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
7536  * info.suboffsets = NULL
7537  */
7538  __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
7539 
7540  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
7541  * else:
7542  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
7543  * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
7544  * info.suboffsets = NULL
7545  * info.itemsize = PyArray_ITEMSIZE(self)
7546  */
7547  __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
7548  }
7549  __pyx_L7:;
7550 
7551  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":234
7552  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
7553  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
7554  * info.suboffsets = NULL # <<<<<<<<<<<<<<
7555  * info.itemsize = PyArray_ITEMSIZE(self)
7556  * info.readonly = not PyArray_ISWRITEABLE(self)
7557  */
7558  __pyx_v_info->suboffsets = NULL;
7559 
7560  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
7561  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
7562  * info.suboffsets = NULL
7563  * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
7564  * info.readonly = not PyArray_ISWRITEABLE(self)
7565  *
7566  */
7567  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
7568 
7569  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
7570  * info.suboffsets = NULL
7571  * info.itemsize = PyArray_ITEMSIZE(self)
7572  * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
7573  *
7574  * cdef int t
7575  */
7576  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
7577 
7578  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":239
7579  *
7580  * cdef int t
7581  * cdef char* f = NULL # <<<<<<<<<<<<<<
7582  * cdef dtype descr = self.descr
7583  * cdef list stack
7584  */
7585  __pyx_v_f = NULL;
7586 
7587  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240
7588  * cdef int t
7589  * cdef char* f = NULL
7590  * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
7591  * cdef list stack
7592  * cdef int offset
7593  */
7594  __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
7595  __Pyx_INCREF(__pyx_t_4);
7596  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
7597  __pyx_t_4 = 0;
7598 
7599  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244
7600  * cdef int offset
7601  *
7602  * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
7603  *
7604  * if not hasfields and not copy_shape:
7605  */
7606  __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
7607 
7608  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
7609  * cdef bint hasfields = PyDataType_HASFIELDS(descr)
7610  *
7611  * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
7612  * # do not call releasebuffer
7613  * info.obj = None
7614  */
7615  __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
7616  if (__pyx_t_2) {
7617  __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0);
7618  __pyx_t_1 = __pyx_t_3;
7619  } else {
7620  __pyx_t_1 = __pyx_t_2;
7621  }
7622  if (__pyx_t_1) {
7623 
7624  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
7625  * if not hasfields and not copy_shape:
7626  * # do not call releasebuffer
7627  * info.obj = None # <<<<<<<<<<<<<<
7628  * else:
7629  * # need to call releasebuffer
7630  */
7631  __Pyx_INCREF(Py_None);
7632  __Pyx_GIVEREF(Py_None);
7633  __Pyx_GOTREF(__pyx_v_info->obj);
7634  __Pyx_DECREF(__pyx_v_info->obj);
7635  __pyx_v_info->obj = Py_None;
7636  goto __pyx_L10;
7637  }
7638  /*else*/ {
7639 
7640  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":251
7641  * else:
7642  * # need to call releasebuffer
7643  * info.obj = self # <<<<<<<<<<<<<<
7644  *
7645  * if not hasfields:
7646  */
7647  __Pyx_INCREF(((PyObject *)__pyx_v_self));
7648  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7649  __Pyx_GOTREF(__pyx_v_info->obj);
7650  __Pyx_DECREF(__pyx_v_info->obj);
7651  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7652  }
7653  __pyx_L10:;
7654 
7655  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
7656  * info.obj = self
7657  *
7658  * if not hasfields: # <<<<<<<<<<<<<<
7659  * t = descr.type_num
7660  * if ((descr.byteorder == c'>' and little_endian) or
7661  */
7662  __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
7663  if (__pyx_t_1) {
7664 
7665  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254
7666  *
7667  * if not hasfields:
7668  * t = descr.type_num # <<<<<<<<<<<<<<
7669  * if ((descr.byteorder == c'>' and little_endian) or
7670  * (descr.byteorder == c'<' and not little_endian)):
7671  */
7672  __pyx_t_5 = __pyx_v_descr->type_num;
7673  __pyx_v_t = __pyx_t_5;
7674 
7675  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":255
7676  * if not hasfields:
7677  * t = descr.type_num
7678  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
7679  * (descr.byteorder == c'<' and not little_endian)):
7680  * raise ValueError(u"Non-native byte order not supported")
7681  */
7682  __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0);
7683  if (__pyx_t_1) {
7684  __pyx_t_2 = (__pyx_v_little_endian != 0);
7685  } else {
7686  __pyx_t_2 = __pyx_t_1;
7687  }
7688  if (!__pyx_t_2) {
7689 
7690  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":256
7691  * t = descr.type_num
7692  * if ((descr.byteorder == c'>' and little_endian) or
7693  * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
7694  * raise ValueError(u"Non-native byte order not supported")
7695  * if t == NPY_BYTE: f = "b"
7696  */
7697  __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0);
7698  if (__pyx_t_1) {
7699  __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0);
7700  __pyx_t_7 = __pyx_t_3;
7701  } else {
7702  __pyx_t_7 = __pyx_t_1;
7703  }
7704  __pyx_t_1 = __pyx_t_7;
7705  } else {
7706  __pyx_t_1 = __pyx_t_2;
7707  }
7708  if (__pyx_t_1) {
7709 
7710  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
7711  * if ((descr.byteorder == c'>' and little_endian) or
7712  * (descr.byteorder == c'<' and not little_endian)):
7713  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
7714  * if t == NPY_BYTE: f = "b"
7715  * elif t == NPY_UBYTE: f = "B"
7716  */
7717  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7718  __Pyx_GOTREF(__pyx_t_4);
7719  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7720  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7721  {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7722  }
7723 
7724  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
7725  * elif t == NPY_CDOUBLE: f = "Zd"
7726  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7727  * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
7728  * else:
7729  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7730  */
7731  switch (__pyx_v_t) {
7732 
7733  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
7734  * (descr.byteorder == c'<' and not little_endian)):
7735  * raise ValueError(u"Non-native byte order not supported")
7736  * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
7737  * elif t == NPY_UBYTE: f = "B"
7738  * elif t == NPY_SHORT: f = "h"
7739  */
7740  case NPY_BYTE:
7741  __pyx_v_f = __pyx_k_b;
7742  break;
7743 
7744  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
7745  * raise ValueError(u"Non-native byte order not supported")
7746  * if t == NPY_BYTE: f = "b"
7747  * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
7748  * elif t == NPY_SHORT: f = "h"
7749  * elif t == NPY_USHORT: f = "H"
7750  */
7751  case NPY_UBYTE:
7752  __pyx_v_f = __pyx_k_B;
7753  break;
7754 
7755  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
7756  * if t == NPY_BYTE: f = "b"
7757  * elif t == NPY_UBYTE: f = "B"
7758  * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
7759  * elif t == NPY_USHORT: f = "H"
7760  * elif t == NPY_INT: f = "i"
7761  */
7762  case NPY_SHORT:
7763  __pyx_v_f = __pyx_k_h;
7764  break;
7765 
7766  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
7767  * elif t == NPY_UBYTE: f = "B"
7768  * elif t == NPY_SHORT: f = "h"
7769  * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
7770  * elif t == NPY_INT: f = "i"
7771  * elif t == NPY_UINT: f = "I"
7772  */
7773  case NPY_USHORT:
7774  __pyx_v_f = __pyx_k_H;
7775  break;
7776 
7777  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
7778  * elif t == NPY_SHORT: f = "h"
7779  * elif t == NPY_USHORT: f = "H"
7780  * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
7781  * elif t == NPY_UINT: f = "I"
7782  * elif t == NPY_LONG: f = "l"
7783  */
7784  case NPY_INT:
7785  __pyx_v_f = __pyx_k_i;
7786  break;
7787 
7788  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
7789  * elif t == NPY_USHORT: f = "H"
7790  * elif t == NPY_INT: f = "i"
7791  * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
7792  * elif t == NPY_LONG: f = "l"
7793  * elif t == NPY_ULONG: f = "L"
7794  */
7795  case NPY_UINT:
7796  __pyx_v_f = __pyx_k_I;
7797  break;
7798 
7799  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
7800  * elif t == NPY_INT: f = "i"
7801  * elif t == NPY_UINT: f = "I"
7802  * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
7803  * elif t == NPY_ULONG: f = "L"
7804  * elif t == NPY_LONGLONG: f = "q"
7805  */
7806  case NPY_LONG:
7807  __pyx_v_f = __pyx_k_l;
7808  break;
7809 
7810  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
7811  * elif t == NPY_UINT: f = "I"
7812  * elif t == NPY_LONG: f = "l"
7813  * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
7814  * elif t == NPY_LONGLONG: f = "q"
7815  * elif t == NPY_ULONGLONG: f = "Q"
7816  */
7817  case NPY_ULONG:
7818  __pyx_v_f = __pyx_k_L;
7819  break;
7820 
7821  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
7822  * elif t == NPY_LONG: f = "l"
7823  * elif t == NPY_ULONG: f = "L"
7824  * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
7825  * elif t == NPY_ULONGLONG: f = "Q"
7826  * elif t == NPY_FLOAT: f = "f"
7827  */
7828  case NPY_LONGLONG:
7829  __pyx_v_f = __pyx_k_q;
7830  break;
7831 
7832  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
7833  * elif t == NPY_ULONG: f = "L"
7834  * elif t == NPY_LONGLONG: f = "q"
7835  * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
7836  * elif t == NPY_FLOAT: f = "f"
7837  * elif t == NPY_DOUBLE: f = "d"
7838  */
7839  case NPY_ULONGLONG:
7840  __pyx_v_f = __pyx_k_Q;
7841  break;
7842 
7843  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
7844  * elif t == NPY_LONGLONG: f = "q"
7845  * elif t == NPY_ULONGLONG: f = "Q"
7846  * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
7847  * elif t == NPY_DOUBLE: f = "d"
7848  * elif t == NPY_LONGDOUBLE: f = "g"
7849  */
7850  case NPY_FLOAT:
7851  __pyx_v_f = __pyx_k_f;
7852  break;
7853 
7854  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
7855  * elif t == NPY_ULONGLONG: f = "Q"
7856  * elif t == NPY_FLOAT: f = "f"
7857  * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
7858  * elif t == NPY_LONGDOUBLE: f = "g"
7859  * elif t == NPY_CFLOAT: f = "Zf"
7860  */
7861  case NPY_DOUBLE:
7862  __pyx_v_f = __pyx_k_d;
7863  break;
7864 
7865  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
7866  * elif t == NPY_FLOAT: f = "f"
7867  * elif t == NPY_DOUBLE: f = "d"
7868  * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
7869  * elif t == NPY_CFLOAT: f = "Zf"
7870  * elif t == NPY_CDOUBLE: f = "Zd"
7871  */
7872  case NPY_LONGDOUBLE:
7873  __pyx_v_f = __pyx_k_g;
7874  break;
7875 
7876  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
7877  * elif t == NPY_DOUBLE: f = "d"
7878  * elif t == NPY_LONGDOUBLE: f = "g"
7879  * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
7880  * elif t == NPY_CDOUBLE: f = "Zd"
7881  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7882  */
7883  case NPY_CFLOAT:
7884  __pyx_v_f = __pyx_k_Zf;
7885  break;
7886 
7887  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
7888  * elif t == NPY_LONGDOUBLE: f = "g"
7889  * elif t == NPY_CFLOAT: f = "Zf"
7890  * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
7891  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7892  * elif t == NPY_OBJECT: f = "O"
7893  */
7894  case NPY_CDOUBLE:
7895  __pyx_v_f = __pyx_k_Zd;
7896  break;
7897 
7898  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
7899  * elif t == NPY_CFLOAT: f = "Zf"
7900  * elif t == NPY_CDOUBLE: f = "Zd"
7901  * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
7902  * elif t == NPY_OBJECT: f = "O"
7903  * else:
7904  */
7905  case NPY_CLONGDOUBLE:
7906  __pyx_v_f = __pyx_k_Zg;
7907  break;
7908 
7909  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
7910  * elif t == NPY_CDOUBLE: f = "Zd"
7911  * elif t == NPY_CLONGDOUBLE: f = "Zg"
7912  * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
7913  * else:
7914  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7915  */
7916  case NPY_OBJECT:
7917  __pyx_v_f = __pyx_k_O;
7918  break;
7919  default:
7920 
7921  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
7922  * elif t == NPY_OBJECT: f = "O"
7923  * else:
7924  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
7925  * info.format = f
7926  * return
7927  */
7928  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7929  __Pyx_GOTREF(__pyx_t_4);
7930  __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7931  __Pyx_GOTREF(__pyx_t_8);
7932  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7933  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7934  __Pyx_GOTREF(__pyx_t_4);
7935  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
7936  __Pyx_GIVEREF(__pyx_t_8);
7937  __pyx_t_8 = 0;
7938  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7939  __Pyx_GOTREF(__pyx_t_8);
7940  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7941  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7942  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7943  {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7944  break;
7945  }
7946 
7947  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277
7948  * else:
7949  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7950  * info.format = f # <<<<<<<<<<<<<<
7951  * return
7952  * else:
7953  */
7954  __pyx_v_info->format = __pyx_v_f;
7955 
7956  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
7957  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7958  * info.format = f
7959  * return # <<<<<<<<<<<<<<
7960  * else:
7961  * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
7962  */
7963  __pyx_r = 0;
7964  goto __pyx_L0;
7965  }
7966  /*else*/ {
7967 
7968  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
7969  * return
7970  * else:
7971  * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
7972  * info.format[0] = c'^' # Native data types, manual alignment
7973  * offset = 0
7974  */
7975  __pyx_v_info->format = ((char *)malloc(255));
7976 
7977  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":281
7978  * else:
7979  * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
7980  * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
7981  * offset = 0
7982  * f = _util_dtypestring(descr, info.format + 1,
7983  */
7984  (__pyx_v_info->format[0]) = '^';
7985 
7986  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
7987  * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
7988  * info.format[0] = c'^' # Native data types, manual alignment
7989  * offset = 0 # <<<<<<<<<<<<<<
7990  * f = _util_dtypestring(descr, info.format + 1,
7991  * info.format + _buffer_format_string_len,
7992  */
7993  __pyx_v_offset = 0;
7994 
7995  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
7996  * info.format[0] = c'^' # Native data types, manual alignment
7997  * offset = 0
7998  * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
7999  * info.format + _buffer_format_string_len,
8000  * &offset)
8001  */
8002  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8003  __pyx_v_f = __pyx_t_9;
8004 
8005  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
8006  * info.format + _buffer_format_string_len,
8007  * &offset)
8008  * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
8009  *
8010  * def __releasebuffer__(ndarray self, Py_buffer* info):
8011  */
8012  (__pyx_v_f[0]) = '\x00';
8013  }
8014 
8015  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":194
8016  * # experimental exception made for __getbuffer__ and __releasebuffer__
8017  * # -- the details of this may change.
8018  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
8019  * # This implementation of getbuffer is geared towards Cython
8020  * # requirements, and does not yet fullfill the PEP.
8021  */
8022 
8023  /* function exit code */
8024  __pyx_r = 0;
8025  goto __pyx_L0;
8026  __pyx_L1_error:;
8027  __Pyx_XDECREF(__pyx_t_4);
8028  __Pyx_XDECREF(__pyx_t_8);
8029  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8030  __pyx_r = -1;
8031  if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
8032  __Pyx_GOTREF(__pyx_v_info->obj);
8033  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
8034  }
8035  goto __pyx_L2;
8036  __pyx_L0:;
8037  if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
8038  __Pyx_GOTREF(Py_None);
8039  __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
8040  }
8041  __pyx_L2:;
8042  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
8043  __Pyx_RefNannyFinishContext();
8044  return __pyx_r;
8045 }
8046 
8047 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
8048  * f[0] = c'\0' # Terminate format string
8049  *
8050  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
8051  * if PyArray_HASFIELDS(self):
8052  * stdlib.free(info.format)
8053  */
8054 
8055 /* Python wrapper */
8056 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
8057 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
8058  __Pyx_RefNannyDeclarations
8059  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
8060  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
8061 
8062  /* function exit code */
8063  __Pyx_RefNannyFinishContext();
8064 }
8065 
8066 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
8067  __Pyx_RefNannyDeclarations
8068  int __pyx_t_1;
8069  __Pyx_RefNannySetupContext("__releasebuffer__", 0);
8070 
8071  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
8072  *
8073  * def __releasebuffer__(ndarray self, Py_buffer* info):
8074  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
8075  * stdlib.free(info.format)
8076  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
8077  */
8078  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
8079  if (__pyx_t_1) {
8080 
8081  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
8082  * def __releasebuffer__(ndarray self, Py_buffer* info):
8083  * if PyArray_HASFIELDS(self):
8084  * stdlib.free(info.format) # <<<<<<<<<<<<<<
8085  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
8086  * stdlib.free(info.strides)
8087  */
8088  free(__pyx_v_info->format);
8089  goto __pyx_L3;
8090  }
8091  __pyx_L3:;
8092 
8093  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
8094  * if PyArray_HASFIELDS(self):
8095  * stdlib.free(info.format)
8096  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
8097  * stdlib.free(info.strides)
8098  * # info.shape was stored after info.strides in the same block
8099  */
8100  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
8101  if (__pyx_t_1) {
8102 
8103  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
8104  * stdlib.free(info.format)
8105  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
8106  * stdlib.free(info.strides) # <<<<<<<<<<<<<<
8107  * # info.shape was stored after info.strides in the same block
8108  *
8109  */
8110  free(__pyx_v_info->strides);
8111  goto __pyx_L4;
8112  }
8113  __pyx_L4:;
8114 
8115  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
8116  * f[0] = c'\0' # Terminate format string
8117  *
8118  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
8119  * if PyArray_HASFIELDS(self):
8120  * stdlib.free(info.format)
8121  */
8122 
8123  /* function exit code */
8124  __Pyx_RefNannyFinishContext();
8125 }
8126 
8127 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
8128  * ctypedef npy_cdouble complex_t
8129  *
8130  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
8131  * return PyArray_MultiIterNew(1, <void*>a)
8132  *
8133  */
8134 
8135 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
8136  PyObject *__pyx_r = NULL;
8137  __Pyx_RefNannyDeclarations
8138  PyObject *__pyx_t_1 = NULL;
8139  int __pyx_lineno = 0;
8140  const char *__pyx_filename = NULL;
8141  int __pyx_clineno = 0;
8142  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
8143 
8144  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769
8145  *
8146  * cdef inline object PyArray_MultiIterNew1(a):
8147  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
8148  *
8149  * cdef inline object PyArray_MultiIterNew2(a, b):
8150  */
8151  __Pyx_XDECREF(__pyx_r);
8152  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8153  __Pyx_GOTREF(__pyx_t_1);
8154  __pyx_r = __pyx_t_1;
8155  __pyx_t_1 = 0;
8156  goto __pyx_L0;
8157 
8158  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":768
8159  * ctypedef npy_cdouble complex_t
8160  *
8161  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
8162  * return PyArray_MultiIterNew(1, <void*>a)
8163  *
8164  */
8165 
8166  /* function exit code */
8167  __pyx_L1_error:;
8168  __Pyx_XDECREF(__pyx_t_1);
8169  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
8170  __pyx_r = 0;
8171  __pyx_L0:;
8172  __Pyx_XGIVEREF(__pyx_r);
8173  __Pyx_RefNannyFinishContext();
8174  return __pyx_r;
8175 }
8176 
8177 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
8178  * return PyArray_MultiIterNew(1, <void*>a)
8179  *
8180  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
8181  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
8182  *
8183  */
8184 
8185 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
8186  PyObject *__pyx_r = NULL;
8187  __Pyx_RefNannyDeclarations
8188  PyObject *__pyx_t_1 = NULL;
8189  int __pyx_lineno = 0;
8190  const char *__pyx_filename = NULL;
8191  int __pyx_clineno = 0;
8192  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
8193 
8194  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":772
8195  *
8196  * cdef inline object PyArray_MultiIterNew2(a, b):
8197  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
8198  *
8199  * cdef inline object PyArray_MultiIterNew3(a, b, c):
8200  */
8201  __Pyx_XDECREF(__pyx_r);
8202  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8203  __Pyx_GOTREF(__pyx_t_1);
8204  __pyx_r = __pyx_t_1;
8205  __pyx_t_1 = 0;
8206  goto __pyx_L0;
8207 
8208  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
8209  * return PyArray_MultiIterNew(1, <void*>a)
8210  *
8211  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
8212  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
8213  *
8214  */
8215 
8216  /* function exit code */
8217  __pyx_L1_error:;
8218  __Pyx_XDECREF(__pyx_t_1);
8219  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
8220  __pyx_r = 0;
8221  __pyx_L0:;
8222  __Pyx_XGIVEREF(__pyx_r);
8223  __Pyx_RefNannyFinishContext();
8224  return __pyx_r;
8225 }
8226 
8227 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
8228  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
8229  *
8230  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
8231  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
8232  *
8233  */
8234 
8235 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
8236  PyObject *__pyx_r = NULL;
8237  __Pyx_RefNannyDeclarations
8238  PyObject *__pyx_t_1 = NULL;
8239  int __pyx_lineno = 0;
8240  const char *__pyx_filename = NULL;
8241  int __pyx_clineno = 0;
8242  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
8243 
8244  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
8245  *
8246  * cdef inline object PyArray_MultiIterNew3(a, b, c):
8247  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
8248  *
8249  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
8250  */
8251  __Pyx_XDECREF(__pyx_r);
8252  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8253  __Pyx_GOTREF(__pyx_t_1);
8254  __pyx_r = __pyx_t_1;
8255  __pyx_t_1 = 0;
8256  goto __pyx_L0;
8257 
8258  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":774
8259  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
8260  *
8261  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
8262  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
8263  *
8264  */
8265 
8266  /* function exit code */
8267  __pyx_L1_error:;
8268  __Pyx_XDECREF(__pyx_t_1);
8269  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
8270  __pyx_r = 0;
8271  __pyx_L0:;
8272  __Pyx_XGIVEREF(__pyx_r);
8273  __Pyx_RefNannyFinishContext();
8274  return __pyx_r;
8275 }
8276 
8277 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
8278  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
8279  *
8280  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
8281  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
8282  *
8283  */
8284 
8285 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
8286  PyObject *__pyx_r = NULL;
8287  __Pyx_RefNannyDeclarations
8288  PyObject *__pyx_t_1 = NULL;
8289  int __pyx_lineno = 0;
8290  const char *__pyx_filename = NULL;
8291  int __pyx_clineno = 0;
8292  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
8293 
8294  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
8295  *
8296  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
8297  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
8298  *
8299  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
8300  */
8301  __Pyx_XDECREF(__pyx_r);
8302  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8303  __Pyx_GOTREF(__pyx_t_1);
8304  __pyx_r = __pyx_t_1;
8305  __pyx_t_1 = 0;
8306  goto __pyx_L0;
8307 
8308  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
8309  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
8310  *
8311  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
8312  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
8313  *
8314  */
8315 
8316  /* function exit code */
8317  __pyx_L1_error:;
8318  __Pyx_XDECREF(__pyx_t_1);
8319  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
8320  __pyx_r = 0;
8321  __pyx_L0:;
8322  __Pyx_XGIVEREF(__pyx_r);
8323  __Pyx_RefNannyFinishContext();
8324  return __pyx_r;
8325 }
8326 
8327 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
8328  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
8329  *
8330  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
8331  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
8332  *
8333  */
8334 
8335 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
8336  PyObject *__pyx_r = NULL;
8337  __Pyx_RefNannyDeclarations
8338  PyObject *__pyx_t_1 = NULL;
8339  int __pyx_lineno = 0;
8340  const char *__pyx_filename = NULL;
8341  int __pyx_clineno = 0;
8342  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
8343 
8344  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
8345  *
8346  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
8347  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
8348  *
8349  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
8350  */
8351  __Pyx_XDECREF(__pyx_r);
8352  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8353  __Pyx_GOTREF(__pyx_t_1);
8354  __pyx_r = __pyx_t_1;
8355  __pyx_t_1 = 0;
8356  goto __pyx_L0;
8357 
8358  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":780
8359  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
8360  *
8361  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
8362  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
8363  *
8364  */
8365 
8366  /* function exit code */
8367  __pyx_L1_error:;
8368  __Pyx_XDECREF(__pyx_t_1);
8369  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
8370  __pyx_r = 0;
8371  __pyx_L0:;
8372  __Pyx_XGIVEREF(__pyx_r);
8373  __Pyx_RefNannyFinishContext();
8374  return __pyx_r;
8375 }
8376 
8377 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
8378  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
8379  *
8380  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
8381  * # Recursive utility function used in __getbuffer__ to get format
8382  * # string. The new location in the format string is returned.
8383  */
8384 
8385 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
8386  PyArray_Descr *__pyx_v_child = 0;
8387  int __pyx_v_endian_detector;
8388  int __pyx_v_little_endian;
8389  PyObject *__pyx_v_fields = 0;
8390  PyObject *__pyx_v_childname = NULL;
8391  PyObject *__pyx_v_new_offset = NULL;
8392  PyObject *__pyx_v_t = NULL;
8393  char *__pyx_r;
8394  __Pyx_RefNannyDeclarations
8395  PyObject *__pyx_t_1 = NULL;
8396  Py_ssize_t __pyx_t_2;
8397  PyObject *__pyx_t_3 = NULL;
8398  PyObject *__pyx_t_4 = NULL;
8399  int __pyx_t_5;
8400  int __pyx_t_6;
8401  int __pyx_t_7;
8402  int __pyx_t_8;
8403  int __pyx_t_9;
8404  long __pyx_t_10;
8405  char *__pyx_t_11;
8406  int __pyx_lineno = 0;
8407  const char *__pyx_filename = NULL;
8408  int __pyx_clineno = 0;
8409  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
8410 
8411  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
8412  * cdef int delta_offset
8413  * cdef tuple i
8414  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
8415  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
8416  * cdef tuple fields
8417  */
8418  __pyx_v_endian_detector = 1;
8419 
8420  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
8421  * cdef tuple i
8422  * cdef int endian_detector = 1
8423  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
8424  * cdef tuple fields
8425  *
8426  */
8427  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
8428 
8429  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
8430  * cdef tuple fields
8431  *
8432  * for childname in descr.names: # <<<<<<<<<<<<<<
8433  * fields = descr.fields[childname]
8434  * child, new_offset = fields
8435  */
8436  if (unlikely(__pyx_v_descr->names == Py_None)) {
8437  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
8438  {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8439  }
8440  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
8441  for (;;) {
8442  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
8443  #if CYTHON_COMPILING_IN_CPYTHON
8444  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8445  #else
8446  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8447  #endif
8448  __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
8449  __pyx_t_3 = 0;
8450 
8451  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":795
8452  *
8453  * for childname in descr.names:
8454  * fields = descr.fields[childname] # <<<<<<<<<<<<<<
8455  * child, new_offset = fields
8456  *
8457  */
8458  __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
8459  __Pyx_GOTREF(__pyx_t_3);
8460  if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8461  __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
8462  __pyx_t_3 = 0;
8463 
8464  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
8465  * for childname in descr.names:
8466  * fields = descr.fields[childname]
8467  * child, new_offset = fields # <<<<<<<<<<<<<<
8468  *
8469  * if (end - f) - <int>(new_offset - offset[0]) < 15:
8470  */
8471  if (likely(__pyx_v_fields != Py_None)) {
8472  PyObject* sequence = __pyx_v_fields;
8473  #if CYTHON_COMPILING_IN_CPYTHON
8474  Py_ssize_t size = Py_SIZE(sequence);
8475  #else
8476  Py_ssize_t size = PySequence_Size(sequence);
8477  #endif
8478  if (unlikely(size != 2)) {
8479  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8480  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8481  {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8482  }
8483  #if CYTHON_COMPILING_IN_CPYTHON
8484  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
8485  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
8486  __Pyx_INCREF(__pyx_t_3);
8487  __Pyx_INCREF(__pyx_t_4);
8488  #else
8489  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8490  __Pyx_GOTREF(__pyx_t_3);
8491  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8492  __Pyx_GOTREF(__pyx_t_4);
8493  #endif
8494  } else {
8495  __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8496  }
8497  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8498  __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
8499  __pyx_t_3 = 0;
8500  __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
8501  __pyx_t_4 = 0;
8502 
8503  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":798
8504  * child, new_offset = fields
8505  *
8506  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
8507  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8508  *
8509  */
8510  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8511  __Pyx_GOTREF(__pyx_t_4);
8512  __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8513  __Pyx_GOTREF(__pyx_t_3);
8514  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8515  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8516  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8517  __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
8518  if (__pyx_t_6) {
8519 
8520  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
8521  *
8522  * if (end - f) - <int>(new_offset - offset[0]) < 15:
8523  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
8524  *
8525  * if ((child.byteorder == c'>' and little_endian) or
8526  */
8527  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8528  __Pyx_GOTREF(__pyx_t_3);
8529  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8530  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8531  {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8532  }
8533 
8534  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
8535  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
8536  *
8537  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
8538  * (child.byteorder == c'<' and not little_endian)):
8539  * raise ValueError(u"Non-native byte order not supported")
8540  */
8541  __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0);
8542  if (__pyx_t_6) {
8543  __pyx_t_7 = (__pyx_v_little_endian != 0);
8544  } else {
8545  __pyx_t_7 = __pyx_t_6;
8546  }
8547  if (!__pyx_t_7) {
8548 
8549  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
8550  *
8551  * if ((child.byteorder == c'>' and little_endian) or
8552  * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
8553  * raise ValueError(u"Non-native byte order not supported")
8554  * # One could encode it in the format string and have Cython
8555  */
8556  __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0);
8557  if (__pyx_t_6) {
8558  __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0);
8559  __pyx_t_9 = __pyx_t_8;
8560  } else {
8561  __pyx_t_9 = __pyx_t_6;
8562  }
8563  __pyx_t_6 = __pyx_t_9;
8564  } else {
8565  __pyx_t_6 = __pyx_t_7;
8566  }
8567  if (__pyx_t_6) {
8568 
8569  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
8570  * if ((child.byteorder == c'>' and little_endian) or
8571  * (child.byteorder == c'<' and not little_endian)):
8572  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
8573  * # One could encode it in the format string and have Cython
8574  * # complain instead, BUT: < and > in format strings also imply
8575  */
8576  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8577  __Pyx_GOTREF(__pyx_t_3);
8578  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8579  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8580  {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8581  }
8582 
8583  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
8584  *
8585  * # Output padding bytes
8586  * while offset[0] < new_offset: # <<<<<<<<<<<<<<
8587  * f[0] = 120 # "x"; pad byte
8588  * f += 1
8589  */
8590  while (1) {
8591  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8592  __Pyx_GOTREF(__pyx_t_3);
8593  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8594  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8595  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8596  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8597  if (!__pyx_t_6) break;
8598 
8599  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
8600  * # Output padding bytes
8601  * while offset[0] < new_offset:
8602  * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
8603  * f += 1
8604  * offset[0] += 1
8605  */
8606  (__pyx_v_f[0]) = 120;
8607 
8608  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
8609  * while offset[0] < new_offset:
8610  * f[0] = 120 # "x"; pad byte
8611  * f += 1 # <<<<<<<<<<<<<<
8612  * offset[0] += 1
8613  *
8614  */
8615  __pyx_v_f = (__pyx_v_f + 1);
8616 
8617  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
8618  * f[0] = 120 # "x"; pad byte
8619  * f += 1
8620  * offset[0] += 1 # <<<<<<<<<<<<<<
8621  *
8622  * offset[0] += child.itemsize
8623  */
8624  __pyx_t_10 = 0;
8625  (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1);
8626  }
8627 
8628  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":818
8629  * offset[0] += 1
8630  *
8631  * offset[0] += child.itemsize # <<<<<<<<<<<<<<
8632  *
8633  * if not PyDataType_HASFIELDS(child):
8634  */
8635  __pyx_t_10 = 0;
8636  (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize);
8637 
8638  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":820
8639  * offset[0] += child.itemsize
8640  *
8641  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
8642  * t = child.type_num
8643  * if end - f < 5:
8644  */
8645  __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
8646  if (__pyx_t_6) {
8647 
8648  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
8649  *
8650  * if not PyDataType_HASFIELDS(child):
8651  * t = child.type_num # <<<<<<<<<<<<<<
8652  * if end - f < 5:
8653  * raise RuntimeError(u"Format string allocated too short.")
8654  */
8655  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8656  __Pyx_GOTREF(__pyx_t_4);
8657  __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
8658  __pyx_t_4 = 0;
8659 
8660  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
8661  * if not PyDataType_HASFIELDS(child):
8662  * t = child.type_num
8663  * if end - f < 5: # <<<<<<<<<<<<<<
8664  * raise RuntimeError(u"Format string allocated too short.")
8665  *
8666  */
8667  __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
8668  if (__pyx_t_6) {
8669 
8670  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
8671  * t = child.type_num
8672  * if end - f < 5:
8673  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
8674  *
8675  * # Until ticket #99 is fixed, use integers to avoid warnings
8676  */
8677  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8678  __Pyx_GOTREF(__pyx_t_4);
8679  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8680  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8681  {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8682  }
8683 
8684  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
8685  *
8686  * # Until ticket #99 is fixed, use integers to avoid warnings
8687  * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
8688  * elif t == NPY_UBYTE: f[0] = 66 #"B"
8689  * elif t == NPY_SHORT: f[0] = 104 #"h"
8690  */
8691  __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8692  __Pyx_GOTREF(__pyx_t_4);
8693  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8694  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8695  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8696  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8697  if (__pyx_t_6) {
8698  (__pyx_v_f[0]) = 98;
8699  goto __pyx_L11;
8700  }
8701 
8702  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
8703  * # Until ticket #99 is fixed, use integers to avoid warnings
8704  * if t == NPY_BYTE: f[0] = 98 #"b"
8705  * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
8706  * elif t == NPY_SHORT: f[0] = 104 #"h"
8707  * elif t == NPY_USHORT: f[0] = 72 #"H"
8708  */
8709  __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8710  __Pyx_GOTREF(__pyx_t_3);
8711  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8712  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8713  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8714  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8715  if (__pyx_t_6) {
8716  (__pyx_v_f[0]) = 66;
8717  goto __pyx_L11;
8718  }
8719 
8720  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
8721  * if t == NPY_BYTE: f[0] = 98 #"b"
8722  * elif t == NPY_UBYTE: f[0] = 66 #"B"
8723  * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
8724  * elif t == NPY_USHORT: f[0] = 72 #"H"
8725  * elif t == NPY_INT: f[0] = 105 #"i"
8726  */
8727  __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8728  __Pyx_GOTREF(__pyx_t_4);
8729  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8730  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8731  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8732  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8733  if (__pyx_t_6) {
8734  (__pyx_v_f[0]) = 104;
8735  goto __pyx_L11;
8736  }
8737 
8738  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
8739  * elif t == NPY_UBYTE: f[0] = 66 #"B"
8740  * elif t == NPY_SHORT: f[0] = 104 #"h"
8741  * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
8742  * elif t == NPY_INT: f[0] = 105 #"i"
8743  * elif t == NPY_UINT: f[0] = 73 #"I"
8744  */
8745  __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8746  __Pyx_GOTREF(__pyx_t_3);
8747  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8748  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8749  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8750  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8751  if (__pyx_t_6) {
8752  (__pyx_v_f[0]) = 72;
8753  goto __pyx_L11;
8754  }
8755 
8756  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
8757  * elif t == NPY_SHORT: f[0] = 104 #"h"
8758  * elif t == NPY_USHORT: f[0] = 72 #"H"
8759  * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
8760  * elif t == NPY_UINT: f[0] = 73 #"I"
8761  * elif t == NPY_LONG: f[0] = 108 #"l"
8762  */
8763  __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8764  __Pyx_GOTREF(__pyx_t_4);
8765  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8766  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8767  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8768  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8769  if (__pyx_t_6) {
8770  (__pyx_v_f[0]) = 105;
8771  goto __pyx_L11;
8772  }
8773 
8774  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
8775  * elif t == NPY_USHORT: f[0] = 72 #"H"
8776  * elif t == NPY_INT: f[0] = 105 #"i"
8777  * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
8778  * elif t == NPY_LONG: f[0] = 108 #"l"
8779  * elif t == NPY_ULONG: f[0] = 76 #"L"
8780  */
8781  __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8782  __Pyx_GOTREF(__pyx_t_3);
8783  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8784  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8785  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8786  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8787  if (__pyx_t_6) {
8788  (__pyx_v_f[0]) = 73;
8789  goto __pyx_L11;
8790  }
8791 
8792  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
8793  * elif t == NPY_INT: f[0] = 105 #"i"
8794  * elif t == NPY_UINT: f[0] = 73 #"I"
8795  * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
8796  * elif t == NPY_ULONG: f[0] = 76 #"L"
8797  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8798  */
8799  __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8800  __Pyx_GOTREF(__pyx_t_4);
8801  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8802  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8803  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8804  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8805  if (__pyx_t_6) {
8806  (__pyx_v_f[0]) = 108;
8807  goto __pyx_L11;
8808  }
8809 
8810  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
8811  * elif t == NPY_UINT: f[0] = 73 #"I"
8812  * elif t == NPY_LONG: f[0] = 108 #"l"
8813  * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
8814  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8815  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8816  */
8817  __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8818  __Pyx_GOTREF(__pyx_t_3);
8819  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8820  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8821  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8822  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8823  if (__pyx_t_6) {
8824  (__pyx_v_f[0]) = 76;
8825  goto __pyx_L11;
8826  }
8827 
8828  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
8829  * elif t == NPY_LONG: f[0] = 108 #"l"
8830  * elif t == NPY_ULONG: f[0] = 76 #"L"
8831  * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
8832  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8833  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8834  */
8835  __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8836  __Pyx_GOTREF(__pyx_t_4);
8837  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8838  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8839  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8840  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8841  if (__pyx_t_6) {
8842  (__pyx_v_f[0]) = 113;
8843  goto __pyx_L11;
8844  }
8845 
8846  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":835
8847  * elif t == NPY_ULONG: f[0] = 76 #"L"
8848  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8849  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
8850  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8851  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8852  */
8853  __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8854  __Pyx_GOTREF(__pyx_t_3);
8855  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8856  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8857  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8858  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8859  if (__pyx_t_6) {
8860  (__pyx_v_f[0]) = 81;
8861  goto __pyx_L11;
8862  }
8863 
8864  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
8865  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
8866  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8867  * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
8868  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8869  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8870  */
8871  __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8872  __Pyx_GOTREF(__pyx_t_4);
8873  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8874  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8875  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8876  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8877  if (__pyx_t_6) {
8878  (__pyx_v_f[0]) = 102;
8879  goto __pyx_L11;
8880  }
8881 
8882  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
8883  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
8884  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8885  * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
8886  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8887  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8888  */
8889  __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8890  __Pyx_GOTREF(__pyx_t_3);
8891  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8892  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8893  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8894  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8895  if (__pyx_t_6) {
8896  (__pyx_v_f[0]) = 100;
8897  goto __pyx_L11;
8898  }
8899 
8900  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
8901  * elif t == NPY_FLOAT: f[0] = 102 #"f"
8902  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8903  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
8904  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8905  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8906  */
8907  __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8908  __Pyx_GOTREF(__pyx_t_4);
8909  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8910  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8911  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8912  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8913  if (__pyx_t_6) {
8914  (__pyx_v_f[0]) = 103;
8915  goto __pyx_L11;
8916  }
8917 
8918  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
8919  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
8920  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8921  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
8922  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8923  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8924  */
8925  __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8926  __Pyx_GOTREF(__pyx_t_3);
8927  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8928  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8929  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8930  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8931  if (__pyx_t_6) {
8932  (__pyx_v_f[0]) = 90;
8933  (__pyx_v_f[1]) = 102;
8934  __pyx_v_f = (__pyx_v_f + 1);
8935  goto __pyx_L11;
8936  }
8937 
8938  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
8939  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
8940  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8941  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
8942  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8943  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8944  */
8945  __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8946  __Pyx_GOTREF(__pyx_t_4);
8947  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8948  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8949  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8950  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8951  if (__pyx_t_6) {
8952  (__pyx_v_f[0]) = 90;
8953  (__pyx_v_f[1]) = 100;
8954  __pyx_v_f = (__pyx_v_f + 1);
8955  goto __pyx_L11;
8956  }
8957 
8958  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
8959  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
8960  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8961  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
8962  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8963  * else:
8964  */
8965  __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8966  __Pyx_GOTREF(__pyx_t_3);
8967  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8968  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8969  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8970  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8971  if (__pyx_t_6) {
8972  (__pyx_v_f[0]) = 90;
8973  (__pyx_v_f[1]) = 103;
8974  __pyx_v_f = (__pyx_v_f + 1);
8975  goto __pyx_L11;
8976  }
8977 
8978  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
8979  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
8980  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
8981  * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
8982  * else:
8983  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
8984  */
8985  __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8986  __Pyx_GOTREF(__pyx_t_4);
8987  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8988  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8989  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8990  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8991  if (__pyx_t_6) {
8992  (__pyx_v_f[0]) = 79;
8993  goto __pyx_L11;
8994  }
8995  /*else*/ {
8996 
8997  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
8998  * elif t == NPY_OBJECT: f[0] = 79 #"O"
8999  * else:
9000  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
9001  * f += 1
9002  * else:
9003  */
9004  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9005  __Pyx_GOTREF(__pyx_t_3);
9006  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9007  __Pyx_GOTREF(__pyx_t_4);
9008  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
9009  __Pyx_GIVEREF(__pyx_t_3);
9010  __pyx_t_3 = 0;
9011  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9012  __Pyx_GOTREF(__pyx_t_3);
9013  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9014  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9015  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9016  {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9017  }
9018  __pyx_L11:;
9019 
9020  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
9021  * else:
9022  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
9023  * f += 1 # <<<<<<<<<<<<<<
9024  * else:
9025  * # Cython ignores struct boundary information ("T{...}"),
9026  */
9027  __pyx_v_f = (__pyx_v_f + 1);
9028  goto __pyx_L9;
9029  }
9030  /*else*/ {
9031 
9032  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849
9033  * # Cython ignores struct boundary information ("T{...}"),
9034  * # so don't output it
9035  * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
9036  * return f
9037  *
9038  */
9039  __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9040  __pyx_v_f = __pyx_t_11;
9041  }
9042  __pyx_L9:;
9043  }
9044  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9045 
9046  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
9047  * # so don't output it
9048  * f = _util_dtypestring(child, f, end, offset)
9049  * return f # <<<<<<<<<<<<<<
9050  *
9051  *
9052  */
9053  __pyx_r = __pyx_v_f;
9054  goto __pyx_L0;
9055 
9056  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
9057  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
9058  *
9059  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
9060  * # Recursive utility function used in __getbuffer__ to get format
9061  * # string. The new location in the format string is returned.
9062  */
9063 
9064  /* function exit code */
9065  __pyx_L1_error:;
9066  __Pyx_XDECREF(__pyx_t_1);
9067  __Pyx_XDECREF(__pyx_t_3);
9068  __Pyx_XDECREF(__pyx_t_4);
9069  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
9070  __pyx_r = NULL;
9071  __pyx_L0:;
9072  __Pyx_XDECREF((PyObject *)__pyx_v_child);
9073  __Pyx_XDECREF(__pyx_v_fields);
9074  __Pyx_XDECREF(__pyx_v_childname);
9075  __Pyx_XDECREF(__pyx_v_new_offset);
9076  __Pyx_XDECREF(__pyx_v_t);
9077  __Pyx_RefNannyFinishContext();
9078  return __pyx_r;
9079 }
9080 
9081 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
9082  *
9083  *
9084  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
9085  * cdef PyObject* baseptr
9086  * if base is None:
9087  */
9088 
9089 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
9090  PyObject *__pyx_v_baseptr;
9091  __Pyx_RefNannyDeclarations
9092  int __pyx_t_1;
9093  int __pyx_t_2;
9094  __Pyx_RefNannySetupContext("set_array_base", 0);
9095 
9096  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":968
9097  * cdef inline void set_array_base(ndarray arr, object base):
9098  * cdef PyObject* baseptr
9099  * if base is None: # <<<<<<<<<<<<<<
9100  * baseptr = NULL
9101  * else:
9102  */
9103  __pyx_t_1 = (__pyx_v_base == Py_None);
9104  __pyx_t_2 = (__pyx_t_1 != 0);
9105  if (__pyx_t_2) {
9106 
9107  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":969
9108  * cdef PyObject* baseptr
9109  * if base is None:
9110  * baseptr = NULL # <<<<<<<<<<<<<<
9111  * else:
9112  * Py_INCREF(base) # important to do this before decref below!
9113  */
9114  __pyx_v_baseptr = NULL;
9115  goto __pyx_L3;
9116  }
9117  /*else*/ {
9118 
9119  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":971
9120  * baseptr = NULL
9121  * else:
9122  * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
9123  * baseptr = <PyObject*>base
9124  * Py_XDECREF(arr.base)
9125  */
9126  Py_INCREF(__pyx_v_base);
9127 
9128  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":972
9129  * else:
9130  * Py_INCREF(base) # important to do this before decref below!
9131  * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
9132  * Py_XDECREF(arr.base)
9133  * arr.base = baseptr
9134  */
9135  __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
9136  }
9137  __pyx_L3:;
9138 
9139  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":973
9140  * Py_INCREF(base) # important to do this before decref below!
9141  * baseptr = <PyObject*>base
9142  * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
9143  * arr.base = baseptr
9144  *
9145  */
9146  Py_XDECREF(__pyx_v_arr->base);
9147 
9148  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":974
9149  * baseptr = <PyObject*>base
9150  * Py_XDECREF(arr.base)
9151  * arr.base = baseptr # <<<<<<<<<<<<<<
9152  *
9153  * cdef inline object get_array_base(ndarray arr):
9154  */
9155  __pyx_v_arr->base = __pyx_v_baseptr;
9156 
9157  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":966
9158  *
9159  *
9160  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
9161  * cdef PyObject* baseptr
9162  * if base is None:
9163  */
9164 
9165  /* function exit code */
9166  __Pyx_RefNannyFinishContext();
9167 }
9168 
9169 /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
9170  * arr.base = baseptr
9171  *
9172  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
9173  * if arr.base is NULL:
9174  * return None
9175  */
9176 
9177 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
9178  PyObject *__pyx_r = NULL;
9179  __Pyx_RefNannyDeclarations
9180  int __pyx_t_1;
9181  __Pyx_RefNannySetupContext("get_array_base", 0);
9182 
9183  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
9184  *
9185  * cdef inline object get_array_base(ndarray arr):
9186  * if arr.base is NULL: # <<<<<<<<<<<<<<
9187  * return None
9188  * else:
9189  */
9190  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
9191  if (__pyx_t_1) {
9192 
9193  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":978
9194  * cdef inline object get_array_base(ndarray arr):
9195  * if arr.base is NULL:
9196  * return None # <<<<<<<<<<<<<<
9197  * else:
9198  * return <object>arr.base
9199  */
9200  __Pyx_XDECREF(__pyx_r);
9201  __Pyx_INCREF(Py_None);
9202  __pyx_r = Py_None;
9203  goto __pyx_L0;
9204  }
9205  /*else*/ {
9206 
9207  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
9208  * return None
9209  * else:
9210  * return <object>arr.base # <<<<<<<<<<<<<<
9211  */
9212  __Pyx_XDECREF(__pyx_r);
9213  __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
9214  __pyx_r = ((PyObject *)__pyx_v_arr->base);
9215  goto __pyx_L0;
9216  }
9217 
9218  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
9219  * arr.base = baseptr
9220  *
9221  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
9222  * if arr.base is NULL:
9223  * return None
9224  */
9225 
9226  /* function exit code */
9227  __pyx_L0:;
9228  __Pyx_XGIVEREF(__pyx_r);
9229  __Pyx_RefNannyFinishContext();
9230  return __pyx_r;
9231 }
9232 
9233 static PyObject *__pyx_tp_new_8freenect_CtxPtr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
9234  PyObject *o;
9235  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
9236  o = (*t->tp_alloc)(t, 0);
9237  } else {
9238  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
9239  }
9240  if (unlikely(!o)) return 0;
9241  return o;
9242 }
9243 
9244 static void __pyx_tp_dealloc_8freenect_CtxPtr(PyObject *o) {
9245  #if PY_VERSION_HEX >= 0x030400a1
9246  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
9247  if (PyObject_CallFinalizerFromDealloc(o)) return;
9248  }
9249  #endif
9250  (*Py_TYPE(o)->tp_free)(o);
9251 }
9252 
9253 static PyMethodDef __pyx_methods_8freenect_CtxPtr[] = {
9254  {0, 0, 0, 0}
9255 };
9256 
9257 static PyTypeObject __pyx_type_8freenect_CtxPtr = {
9258  PyVarObject_HEAD_INIT(0, 0)
9259  __Pyx_NAMESTR("freenect.CtxPtr"), /*tp_name*/
9260  sizeof(struct __pyx_obj_8freenect_CtxPtr), /*tp_basicsize*/
9261  0, /*tp_itemsize*/
9262  __pyx_tp_dealloc_8freenect_CtxPtr, /*tp_dealloc*/
9263  0, /*tp_print*/
9264  0, /*tp_getattr*/
9265  0, /*tp_setattr*/
9266  #if PY_MAJOR_VERSION < 3
9267  0, /*tp_compare*/
9268  #else
9269  0, /*reserved*/
9270  #endif
9271  __pyx_pw_8freenect_6CtxPtr_3__repr__, /*tp_repr*/
9272  0, /*tp_as_number*/
9273  0, /*tp_as_sequence*/
9274  0, /*tp_as_mapping*/
9275  0, /*tp_hash*/
9276  0, /*tp_call*/
9277  0, /*tp_str*/
9278  0, /*tp_getattro*/
9279  0, /*tp_setattro*/
9280  0, /*tp_as_buffer*/
9281  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
9282  0, /*tp_doc*/
9283  0, /*tp_traverse*/
9284  0, /*tp_clear*/
9285  0, /*tp_richcompare*/
9286  0, /*tp_weaklistoffset*/
9287  0, /*tp_iter*/
9288  0, /*tp_iternext*/
9289  __pyx_methods_8freenect_CtxPtr, /*tp_methods*/
9290  0, /*tp_members*/
9291  0, /*tp_getset*/
9292  0, /*tp_base*/
9293  0, /*tp_dict*/
9294  0, /*tp_descr_get*/
9295  0, /*tp_descr_set*/
9296  0, /*tp_dictoffset*/
9297  __pyx_pw_8freenect_6CtxPtr_1__init__, /*tp_init*/
9298  0, /*tp_alloc*/
9299  __pyx_tp_new_8freenect_CtxPtr, /*tp_new*/
9300  0, /*tp_free*/
9301  0, /*tp_is_gc*/
9302  0, /*tp_bases*/
9303  0, /*tp_mro*/
9304  0, /*tp_cache*/
9305  0, /*tp_subclasses*/
9306  0, /*tp_weaklist*/
9307  0, /*tp_del*/
9308  #if PY_VERSION_HEX >= 0x02060000
9309  0, /*tp_version_tag*/
9310  #endif
9311  #if PY_VERSION_HEX >= 0x030400a1
9312  0, /*tp_finalize*/
9313  #endif
9314 };
9315 
9316 static PyObject *__pyx_tp_new_8freenect_DevPtr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
9317  struct __pyx_obj_8freenect_DevPtr *p;
9318  PyObject *o;
9319  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
9320  o = (*t->tp_alloc)(t, 0);
9321  } else {
9322  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
9323  }
9324  if (unlikely(!o)) return 0;
9325  p = ((struct __pyx_obj_8freenect_DevPtr *)o);
9326  p->ctx = ((struct __pyx_obj_8freenect_CtxPtr *)Py_None); Py_INCREF(Py_None);
9327  return o;
9328 }
9329 
9330 static void __pyx_tp_dealloc_8freenect_DevPtr(PyObject *o) {
9331  struct __pyx_obj_8freenect_DevPtr *p = (struct __pyx_obj_8freenect_DevPtr *)o;
9332  #if PY_VERSION_HEX >= 0x030400a1
9333  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
9334  if (PyObject_CallFinalizerFromDealloc(o)) return;
9335  }
9336  #endif
9337  PyObject_GC_UnTrack(o);
9338  Py_CLEAR(p->ctx);
9339  (*Py_TYPE(o)->tp_free)(o);
9340 }
9341 
9342 static int __pyx_tp_traverse_8freenect_DevPtr(PyObject *o, visitproc v, void *a) {
9343  int e;
9344  struct __pyx_obj_8freenect_DevPtr *p = (struct __pyx_obj_8freenect_DevPtr *)o;
9345  if (p->ctx) {
9346  e = (*v)(((PyObject*)p->ctx), a); if (e) return e;
9347  }
9348  return 0;
9349 }
9350 
9351 static int __pyx_tp_clear_8freenect_DevPtr(PyObject *o) {
9352  PyObject* tmp;
9353  struct __pyx_obj_8freenect_DevPtr *p = (struct __pyx_obj_8freenect_DevPtr *)o;
9354  tmp = ((PyObject*)p->ctx);
9355  p->ctx = ((struct __pyx_obj_8freenect_CtxPtr *)Py_None); Py_INCREF(Py_None);
9356  Py_XDECREF(tmp);
9357  return 0;
9358 }
9359 
9360 static PyMethodDef __pyx_methods_8freenect_DevPtr[] = {
9361  {0, 0, 0, 0}
9362 };
9363 
9364 static PyTypeObject __pyx_type_8freenect_DevPtr = {
9365  PyVarObject_HEAD_INIT(0, 0)
9366  __Pyx_NAMESTR("freenect.DevPtr"), /*tp_name*/
9367  sizeof(struct __pyx_obj_8freenect_DevPtr), /*tp_basicsize*/
9368  0, /*tp_itemsize*/
9369  __pyx_tp_dealloc_8freenect_DevPtr, /*tp_dealloc*/
9370  0, /*tp_print*/
9371  0, /*tp_getattr*/
9372  0, /*tp_setattr*/
9373  #if PY_MAJOR_VERSION < 3
9374  0, /*tp_compare*/
9375  #else
9376  0, /*reserved*/
9377  #endif
9378  __pyx_pw_8freenect_6DevPtr_3__repr__, /*tp_repr*/
9379  0, /*tp_as_number*/
9380  0, /*tp_as_sequence*/
9381  0, /*tp_as_mapping*/
9382  0, /*tp_hash*/
9383  0, /*tp_call*/
9384  0, /*tp_str*/
9385  0, /*tp_getattro*/
9386  0, /*tp_setattro*/
9387  0, /*tp_as_buffer*/
9388  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
9389  0, /*tp_doc*/
9390  __pyx_tp_traverse_8freenect_DevPtr, /*tp_traverse*/
9391  __pyx_tp_clear_8freenect_DevPtr, /*tp_clear*/
9392  0, /*tp_richcompare*/
9393  0, /*tp_weaklistoffset*/
9394  0, /*tp_iter*/
9395  0, /*tp_iternext*/
9396  __pyx_methods_8freenect_DevPtr, /*tp_methods*/
9397  0, /*tp_members*/
9398  0, /*tp_getset*/
9399  0, /*tp_base*/
9400  0, /*tp_dict*/
9401  0, /*tp_descr_get*/
9402  0, /*tp_descr_set*/
9403  0, /*tp_dictoffset*/
9404  __pyx_pw_8freenect_6DevPtr_1__init__, /*tp_init*/
9405  0, /*tp_alloc*/
9406  __pyx_tp_new_8freenect_DevPtr, /*tp_new*/
9407  0, /*tp_free*/
9408  0, /*tp_is_gc*/
9409  0, /*tp_bases*/
9410  0, /*tp_mro*/
9411  0, /*tp_cache*/
9412  0, /*tp_subclasses*/
9413  0, /*tp_weaklist*/
9414  0, /*tp_del*/
9415  #if PY_VERSION_HEX >= 0x02060000
9416  0, /*tp_version_tag*/
9417  #endif
9418  #if PY_VERSION_HEX >= 0x030400a1
9419  0, /*tp_finalize*/
9420  #endif
9421 };
9422 
9423 static PyObject *__pyx_tp_new_8freenect_StatePtr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
9424  PyObject *o;
9425  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
9426  o = (*t->tp_alloc)(t, 0);
9427  } else {
9428  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
9429  }
9430  if (unlikely(!o)) return 0;
9431  return o;
9432 }
9433 
9434 static void __pyx_tp_dealloc_8freenect_StatePtr(PyObject *o) {
9435  #if PY_VERSION_HEX >= 0x030400a1
9436  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
9437  if (PyObject_CallFinalizerFromDealloc(o)) return;
9438  }
9439  #endif
9440  (*Py_TYPE(o)->tp_free)(o);
9441 }
9442 
9443 static PyMethodDef __pyx_methods_8freenect_StatePtr[] = {
9444  {__Pyx_NAMESTR("_get_accelx"), (PyCFunction)__pyx_pw_8freenect_8StatePtr_5_get_accelx, METH_NOARGS, __Pyx_DOCSTR(0)},
9445  {__Pyx_NAMESTR("_get_accely"), (PyCFunction)__pyx_pw_8freenect_8StatePtr_7_get_accely, METH_NOARGS, __Pyx_DOCSTR(0)},
9446  {__Pyx_NAMESTR("_get_accelz"), (PyCFunction)__pyx_pw_8freenect_8StatePtr_9_get_accelz, METH_NOARGS, __Pyx_DOCSTR(0)},
9447  {__Pyx_NAMESTR("_get_tilt_angle"), (PyCFunction)__pyx_pw_8freenect_8StatePtr_11_get_tilt_angle, METH_NOARGS, __Pyx_DOCSTR(0)},
9448  {__Pyx_NAMESTR("_get_tilt_status"), (PyCFunction)__pyx_pw_8freenect_8StatePtr_13_get_tilt_status, METH_NOARGS, __Pyx_DOCSTR(0)},
9449  {0, 0, 0, 0}
9450 };
9451 
9452 static PyTypeObject __pyx_type_8freenect_StatePtr = {
9453  PyVarObject_HEAD_INIT(0, 0)
9454  __Pyx_NAMESTR("freenect.StatePtr"), /*tp_name*/
9455  sizeof(struct __pyx_obj_8freenect_StatePtr), /*tp_basicsize*/
9456  0, /*tp_itemsize*/
9457  __pyx_tp_dealloc_8freenect_StatePtr, /*tp_dealloc*/
9458  0, /*tp_print*/
9459  0, /*tp_getattr*/
9460  0, /*tp_setattr*/
9461  #if PY_MAJOR_VERSION < 3
9462  0, /*tp_compare*/
9463  #else
9464  0, /*reserved*/
9465  #endif
9466  __pyx_pw_8freenect_8StatePtr_3__repr__, /*tp_repr*/
9467  0, /*tp_as_number*/
9468  0, /*tp_as_sequence*/
9469  0, /*tp_as_mapping*/
9470  0, /*tp_hash*/
9471  0, /*tp_call*/
9472  0, /*tp_str*/
9473  0, /*tp_getattro*/
9474  0, /*tp_setattro*/
9475  0, /*tp_as_buffer*/
9476  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
9477  0, /*tp_doc*/
9478  0, /*tp_traverse*/
9479  0, /*tp_clear*/
9480  0, /*tp_richcompare*/
9481  0, /*tp_weaklistoffset*/
9482  0, /*tp_iter*/
9483  0, /*tp_iternext*/
9484  __pyx_methods_8freenect_StatePtr, /*tp_methods*/
9485  0, /*tp_members*/
9486  0, /*tp_getset*/
9487  0, /*tp_base*/
9488  0, /*tp_dict*/
9489  0, /*tp_descr_get*/
9490  0, /*tp_descr_set*/
9491  0, /*tp_dictoffset*/
9492  __pyx_pw_8freenect_8StatePtr_1__init__, /*tp_init*/
9493  0, /*tp_alloc*/
9494  __pyx_tp_new_8freenect_StatePtr, /*tp_new*/
9495  0, /*tp_free*/
9496  0, /*tp_is_gc*/
9497  0, /*tp_bases*/
9498  0, /*tp_mro*/
9499  0, /*tp_cache*/
9500  0, /*tp_subclasses*/
9501  0, /*tp_weaklist*/
9502  0, /*tp_del*/
9503  #if PY_VERSION_HEX >= 0x02060000
9504  0, /*tp_version_tag*/
9505  #endif
9506  #if PY_VERSION_HEX >= 0x030400a1
9507  0, /*tp_finalize*/
9508  #endif
9509 };
9510 
9511 static PyMethodDef __pyx_methods[] = {
9512  {__Pyx_NAMESTR("init"), (PyCFunction)__pyx_pw_8freenect_41init, METH_NOARGS, __Pyx_DOCSTR(0)},
9513  {__Pyx_NAMESTR("open_device"), (PyCFunction)__pyx_pw_8freenect_43open_device, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
9514  {0, 0, 0, 0}
9515 };
9516 
9517 #if PY_MAJOR_VERSION >= 3
9518 static struct PyModuleDef __pyx_moduledef = {
9519  #if PY_VERSION_HEX < 0x03020000
9520  { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
9521  #else
9522  PyModuleDef_HEAD_INIT,
9523  #endif
9524  __Pyx_NAMESTR("freenect"),
9525  0, /* m_doc */
9526  -1, /* m_size */
9527  __pyx_methods /* m_methods */,
9528  NULL, /* m_reload */
9529  NULL, /* m_traverse */
9530  NULL, /* m_clear */
9531  NULL /* m_free */
9532 };
9533 #endif
9534 
9535 static __Pyx_StringTabEntry __pyx_string_tab[] = {
9536  {&__pyx_kp_s_0x_016x, __pyx_k_0x_016x, sizeof(__pyx_k_0x_016x), 0, 0, 1, 0},
9537  {&__pyx_kp_s_0x_08x, __pyx_k_0x_08x, sizeof(__pyx_k_0x_08x), 0, 0, 1, 0},
9538  {&__pyx_kp_s_Cannot_create_instances_of_CtxPt, __pyx_k_Cannot_create_instances_of_CtxPt, sizeof(__pyx_k_Cannot_create_instances_of_CtxPt), 0, 0, 1, 0},
9539  {&__pyx_kp_s_Cannot_create_instances_of_DevPt, __pyx_k_Cannot_create_instances_of_DevPt, sizeof(__pyx_k_Cannot_create_instances_of_DevPt), 0, 0, 1, 0},
9540  {&__pyx_kp_s_Cannot_create_instances_of_State, __pyx_k_Cannot_create_instances_of_State, sizeof(__pyx_k_Cannot_create_instances_of_State), 0, 0, 1, 0},
9541  {&__pyx_kp_s_Conversion_not_implemented_for_t, __pyx_k_Conversion_not_implemented_for_t, sizeof(__pyx_k_Conversion_not_implemented_for_t), 0, 0, 1, 0},
9542  {&__pyx_kp_s_Ctx_Pointer_s, __pyx_k_Ctx_Pointer_s, sizeof(__pyx_k_Ctx_Pointer_s), 0, 0, 1, 0},
9543  {&__pyx_n_s_DEPTH_10BIT, __pyx_k_DEPTH_10BIT, sizeof(__pyx_k_DEPTH_10BIT), 0, 0, 1, 1},
9544  {&__pyx_n_s_DEPTH_10BIT_PACKED, __pyx_k_DEPTH_10BIT_PACKED, sizeof(__pyx_k_DEPTH_10BIT_PACKED), 0, 0, 1, 1},
9545  {&__pyx_n_s_DEPTH_11BIT, __pyx_k_DEPTH_11BIT, sizeof(__pyx_k_DEPTH_11BIT), 0, 0, 1, 1},
9546  {&__pyx_n_s_DEPTH_11BIT_PACKED, __pyx_k_DEPTH_11BIT_PACKED, sizeof(__pyx_k_DEPTH_11BIT_PACKED), 0, 0, 1, 1},
9547  {&__pyx_n_s_DEPTH_MM, __pyx_k_DEPTH_MM, sizeof(__pyx_k_DEPTH_MM), 0, 0, 1, 1},
9548  {&__pyx_n_s_DEPTH_REGISTERED, __pyx_k_DEPTH_REGISTERED, sizeof(__pyx_k_DEPTH_REGISTERED), 0, 0, 1, 1},
9549  {&__pyx_n_s_DEVICE_AUDIO, __pyx_k_DEVICE_AUDIO, sizeof(__pyx_k_DEVICE_AUDIO), 0, 0, 1, 1},
9550  {&__pyx_n_s_DEVICE_CAMERA, __pyx_k_DEVICE_CAMERA, sizeof(__pyx_k_DEVICE_CAMERA), 0, 0, 1, 1},
9551  {&__pyx_n_s_DEVICE_MOTOR, __pyx_k_DEVICE_MOTOR, sizeof(__pyx_k_DEVICE_MOTOR), 0, 0, 1, 1},
9552  {&__pyx_kp_s_Dev_Pointer_s, __pyx_k_Dev_Pointer_s, sizeof(__pyx_k_Dev_Pointer_s), 0, 0, 1, 0},
9553  {&__pyx_kp_s_Error_Can_t_open_device_1_is_it, __pyx_k_Error_Can_t_open_device_1_is_it, sizeof(__pyx_k_Error_Can_t_open_device_1_is_it), 0, 0, 1, 0},
9554  {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1},
9555  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
9556  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
9557  {&__pyx_n_s_Kill, __pyx_k_Kill, sizeof(__pyx_k_Kill), 0, 0, 1, 1},
9558  {&__pyx_n_s_LED_BLINK_GREEN, __pyx_k_LED_BLINK_GREEN, sizeof(__pyx_k_LED_BLINK_GREEN), 0, 0, 1, 1},
9559  {&__pyx_n_s_LED_BLINK_RED_YELLOW, __pyx_k_LED_BLINK_RED_YELLOW, sizeof(__pyx_k_LED_BLINK_RED_YELLOW), 0, 0, 1, 1},
9560  {&__pyx_n_s_LED_GREEN, __pyx_k_LED_GREEN, sizeof(__pyx_k_LED_GREEN), 0, 0, 1, 1},
9561  {&__pyx_n_s_LED_OFF, __pyx_k_LED_OFF, sizeof(__pyx_k_LED_OFF), 0, 0, 1, 1},
9562  {&__pyx_n_s_LED_RED, __pyx_k_LED_RED, sizeof(__pyx_k_LED_RED), 0, 0, 1, 1},
9563  {&__pyx_n_s_LED_YELLOW, __pyx_k_LED_YELLOW, sizeof(__pyx_k_LED_YELLOW), 0, 0, 1, 1},
9564  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
9565  {&__pyx_n_s_RESOLUTION_HIGH, __pyx_k_RESOLUTION_HIGH, sizeof(__pyx_k_RESOLUTION_HIGH), 0, 0, 1, 1},
9566  {&__pyx_n_s_RESOLUTION_LOW, __pyx_k_RESOLUTION_LOW, sizeof(__pyx_k_RESOLUTION_LOW), 0, 0, 1, 1},
9567  {&__pyx_n_s_RESOLUTION_MEDIUM, __pyx_k_RESOLUTION_MEDIUM, sizeof(__pyx_k_RESOLUTION_MEDIUM), 0, 0, 1, 1},
9568  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
9569  {&__pyx_kp_s_State_Pointer_s, __pyx_k_State_Pointer_s, sizeof(__pyx_k_State_Pointer_s), 0, 0, 1, 0},
9570  {&__pyx_kp_s_This_kills_the_runloop_raise_fro, __pyx_k_This_kills_the_runloop_raise_fro, sizeof(__pyx_k_This_kills_the_runloop_raise_fro), 0, 0, 1, 0},
9571  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
9572  {&__pyx_n_s_VIDEO_BAYER, __pyx_k_VIDEO_BAYER, sizeof(__pyx_k_VIDEO_BAYER), 0, 0, 1, 1},
9573  {&__pyx_n_s_VIDEO_IR_10BIT, __pyx_k_VIDEO_IR_10BIT, sizeof(__pyx_k_VIDEO_IR_10BIT), 0, 0, 1, 1},
9574  {&__pyx_n_s_VIDEO_IR_10BIT_PACKED, __pyx_k_VIDEO_IR_10BIT_PACKED, sizeof(__pyx_k_VIDEO_IR_10BIT_PACKED), 0, 0, 1, 1},
9575  {&__pyx_n_s_VIDEO_IR_8BIT, __pyx_k_VIDEO_IR_8BIT, sizeof(__pyx_k_VIDEO_IR_8BIT), 0, 0, 1, 1},
9576  {&__pyx_n_s_VIDEO_RGB, __pyx_k_VIDEO_RGB, sizeof(__pyx_k_VIDEO_RGB), 0, 0, 1, 1},
9577  {&__pyx_n_s_VIDEO_YUV_RAW, __pyx_k_VIDEO_YUV_RAW, sizeof(__pyx_k_VIDEO_YUV_RAW), 0, 0, 1, 1},
9578  {&__pyx_n_s_VIDEO_YUV_RGB, __pyx_k_VIDEO_YUV_RGB, sizeof(__pyx_k_VIDEO_YUV_RGB), 0, 0, 1, 1},
9579  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
9580  {&__pyx_kp_s_What_kind_of_system_are_you_usin, __pyx_k_What_kind_of_system_are_you_usin, sizeof(__pyx_k_What_kind_of_system_are_you_usin), 0, 0, 1, 0},
9581  {&__pyx_n_s_accelerometer_x, __pyx_k_accelerometer_x, sizeof(__pyx_k_accelerometer_x), 0, 0, 1, 1},
9582  {&__pyx_n_s_accelerometer_y, __pyx_k_accelerometer_y, sizeof(__pyx_k_accelerometer_y), 0, 0, 1, 1},
9583  {&__pyx_n_s_accelerometer_z, __pyx_k_accelerometer_z, sizeof(__pyx_k_accelerometer_z), 0, 0, 1, 1},
9584  {&__pyx_n_s_angle, __pyx_k_angle, sizeof(__pyx_k_angle), 0, 0, 1, 1},
9585  {&__pyx_n_s_base_runloop, __pyx_k_base_runloop, sizeof(__pyx_k_base_runloop), 0, 0, 1, 1},
9586  {&__pyx_n_s_body, __pyx_k_body, sizeof(__pyx_k_body), 0, 0, 1, 1},
9587  {&__pyx_n_s_cb, __pyx_k_cb, sizeof(__pyx_k_cb), 0, 0, 1, 1},
9588  {&__pyx_n_s_close_device, __pyx_k_close_device, sizeof(__pyx_k_close_device), 0, 0, 1, 1},
9589  {&__pyx_n_s_ctx, __pyx_k_ctx, sizeof(__pyx_k_ctx), 0, 0, 1, 1},
9590  {&__pyx_n_s_ctxp, __pyx_k_ctxp, sizeof(__pyx_k_ctxp), 0, 0, 1, 1},
9591  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
9592  {&__pyx_n_s_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 0, 1, 1},
9593  {&__pyx_n_s_depth_cb, __pyx_k_depth_cb, sizeof(__pyx_k_depth_cb), 0, 0, 1, 1},
9594  {&__pyx_n_s_dev, __pyx_k_dev, sizeof(__pyx_k_dev), 0, 0, 1, 1},
9595  {&__pyx_n_s_devp, __pyx_k_devp, sizeof(__pyx_k_devp), 0, 0, 1, 1},
9596  {&__pyx_n_s_dims, __pyx_k_dims, sizeof(__pyx_k_dims), 0, 0, 1, 1},
9597  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
9598  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
9599  {&__pyx_n_s_error_open_device, __pyx_k_error_open_device, sizeof(__pyx_k_error_open_device), 0, 0, 1, 1},
9600  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
9601  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
9602  {&__pyx_n_s_format_2, __pyx_k_format_2, sizeof(__pyx_k_format_2), 0, 0, 1, 1},
9603  {&__pyx_n_s_freenect, __pyx_k_freenect, sizeof(__pyx_k_freenect), 0, 0, 1, 1},
9604  {&__pyx_kp_s_freenect_pyx, __pyx_k_freenect_pyx, sizeof(__pyx_k_freenect_pyx), 0, 0, 1, 0},
9605  {&__pyx_n_s_get_accel, __pyx_k_get_accel, sizeof(__pyx_k_get_accel), 0, 0, 1, 1},
9606  {&__pyx_n_s_get_accelx, __pyx_k_get_accelx, sizeof(__pyx_k_get_accelx), 0, 0, 1, 1},
9607  {&__pyx_n_s_get_accely, __pyx_k_get_accely, sizeof(__pyx_k_get_accely), 0, 0, 1, 1},
9608  {&__pyx_n_s_get_accelz, __pyx_k_get_accelz, sizeof(__pyx_k_get_accelz), 0, 0, 1, 1},
9609  {&__pyx_n_s_get_depth_format, __pyx_k_get_depth_format, sizeof(__pyx_k_get_depth_format), 0, 0, 1, 1},
9610  {&__pyx_n_s_get_mks_accel, __pyx_k_get_mks_accel, sizeof(__pyx_k_get_mks_accel), 0, 0, 1, 1},
9611  {&__pyx_n_s_get_tilt_angle, __pyx_k_get_tilt_angle, sizeof(__pyx_k_get_tilt_angle), 0, 0, 1, 1},
9612  {&__pyx_n_s_get_tilt_degs, __pyx_k_get_tilt_degs, sizeof(__pyx_k_get_tilt_degs), 0, 0, 1, 1},
9613  {&__pyx_n_s_get_tilt_state, __pyx_k_get_tilt_state, sizeof(__pyx_k_get_tilt_state), 0, 0, 1, 1},
9614  {&__pyx_n_s_get_tilt_status, __pyx_k_get_tilt_status, sizeof(__pyx_k_get_tilt_status), 0, 0, 1, 1},
9615  {&__pyx_n_s_get_video_format, __pyx_k_get_video_format, sizeof(__pyx_k_get_video_format), 0, 0, 1, 1},
9616  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
9617  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
9618  {&__pyx_n_s_index_2, __pyx_k_index_2, sizeof(__pyx_k_index_2), 0, 0, 1, 1},
9619  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
9620  {&__pyx_n_s_mdev, __pyx_k_mdev, sizeof(__pyx_k_mdev), 0, 0, 1, 1},
9621  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
9622  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
9623  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
9624  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
9625  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
9626  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
9627  {&__pyx_n_s_num_devices, __pyx_k_num_devices, sizeof(__pyx_k_num_devices), 0, 0, 1, 1},
9628  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
9629  {&__pyx_n_s_option, __pyx_k_option, sizeof(__pyx_k_option), 0, 0, 1, 1},
9630  {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
9631  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
9632  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
9633  {&__pyx_n_s_process_events, __pyx_k_process_events, sizeof(__pyx_k_process_events), 0, 0, 1, 1},
9634  {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
9635  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
9636  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
9637  {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
9638  {&__pyx_n_s_runloop, __pyx_k_runloop, sizeof(__pyx_k_runloop), 0, 0, 1, 1},
9639  {&__pyx_n_s_set_depth_callback, __pyx_k_set_depth_callback, sizeof(__pyx_k_set_depth_callback), 0, 0, 1, 1},
9640  {&__pyx_n_s_set_depth_mode, __pyx_k_set_depth_mode, sizeof(__pyx_k_set_depth_mode), 0, 0, 1, 1},
9641  {&__pyx_n_s_set_led, __pyx_k_set_led, sizeof(__pyx_k_set_led), 0, 0, 1, 1},
9642  {&__pyx_n_s_set_tilt_degs, __pyx_k_set_tilt_degs, sizeof(__pyx_k_set_tilt_degs), 0, 0, 1, 1},
9643  {&__pyx_n_s_set_video_callback, __pyx_k_set_video_callback, sizeof(__pyx_k_set_video_callback), 0, 0, 1, 1},
9644  {&__pyx_n_s_set_video_mode, __pyx_k_set_video_mode, sizeof(__pyx_k_set_video_mode), 0, 0, 1, 1},
9645  {&__pyx_n_s_shutdown, __pyx_k_shutdown, sizeof(__pyx_k_shutdown), 0, 0, 1, 1},
9646  {&__pyx_n_s_start_depth, __pyx_k_start_depth, sizeof(__pyx_k_start_depth), 0, 0, 1, 1},
9647  {&__pyx_n_s_start_video, __pyx_k_start_video, sizeof(__pyx_k_start_video), 0, 0, 1, 1},
9648  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
9649  {&__pyx_n_s_state_out, __pyx_k_state_out, sizeof(__pyx_k_state_out), 0, 0, 1, 1},
9650  {&__pyx_n_s_stop_depth, __pyx_k_stop_depth, sizeof(__pyx_k_stop_depth), 0, 0, 1, 1},
9651  {&__pyx_n_s_stop_video, __pyx_k_stop_video, sizeof(__pyx_k_stop_video), 0, 0, 1, 1},
9652  {&__pyx_n_s_sync_get_depth, __pyx_k_sync_get_depth, sizeof(__pyx_k_sync_get_depth), 0, 0, 1, 1},
9653  {&__pyx_n_s_sync_get_video, __pyx_k_sync_get_video, sizeof(__pyx_k_sync_get_video), 0, 0, 1, 1},
9654  {&__pyx_n_s_sync_stop, __pyx_k_sync_stop, sizeof(__pyx_k_sync_stop), 0, 0, 1, 1},
9655  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
9656  {&__pyx_n_s_tilt_angle, __pyx_k_tilt_angle, sizeof(__pyx_k_tilt_angle), 0, 0, 1, 1},
9657  {&__pyx_n_s_tilt_status, __pyx_k_tilt_status, sizeof(__pyx_k_tilt_status), 0, 0, 1, 1},
9658  {&__pyx_n_s_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 0, 1, 1},
9659  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
9660  {&__pyx_n_s_update_tilt_state, __pyx_k_update_tilt_state, sizeof(__pyx_k_update_tilt_state), 0, 0, 1, 1},
9661  {&__pyx_n_s_video, __pyx_k_video, sizeof(__pyx_k_video), 0, 0, 1, 1},
9662  {&__pyx_n_s_video_cb, __pyx_k_video_cb, sizeof(__pyx_k_video_cb), 0, 0, 1, 1},
9663  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
9664  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
9665  {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1},
9666  {0, 0, 0, 0, 0, 0, 0}
9667 };
9668 static int __Pyx_InitCachedBuiltins(void) {
9669  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9670  __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9671  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9672  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9673  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9674  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9675  return 0;
9676  __pyx_L1_error:;
9677  return -1;
9678 }
9679 
9680 static int __Pyx_InitCachedConstants(void) {
9681  __Pyx_RefNannyDeclarations
9682  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
9683 
9684  /* "freenect.pyx":174
9685  * return "0x%016x" % <Py_ssize_t>ptr
9686  * else:
9687  * raise TypeError("What kind of system are you using?!") # <<<<<<<<<<<<<<
9688  *
9689  * cdef class CtxPtr:
9690  */
9691  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_What_kind_of_system_are_you_usin); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9692  __Pyx_GOTREF(__pyx_tuple_);
9693  __Pyx_GIVEREF(__pyx_tuple_);
9694 
9695  /* "freenect.pyx":180
9696  * def __init__(self):
9697  * # Safety: do not allow Python to create instances as they would be NULL
9698  * raise TypeError("Cannot create instances of CtxPtr from Python") # <<<<<<<<<<<<<<
9699  *
9700  * def __repr__(self):
9701  */
9702  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_instances_of_CtxPt); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9703  __Pyx_GOTREF(__pyx_tuple__2);
9704  __Pyx_GIVEREF(__pyx_tuple__2);
9705 
9706  /* "freenect.pyx":190
9707  * def __init__(self):
9708  * # Safety: do not allow Python to create instances as they would be NULL
9709  * raise TypeError("Cannot create instances of DevPtr from Python") # <<<<<<<<<<<<<<
9710  *
9711  * def __repr__(self):
9712  */
9713  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_instances_of_DevPt); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9714  __Pyx_GOTREF(__pyx_tuple__3);
9715  __Pyx_GIVEREF(__pyx_tuple__3);
9716 
9717  /* "freenect.pyx":199
9718  * def __init__(self):
9719  * # Safety: do not allow Python to create instances as they would be NULL
9720  * raise TypeError("Cannot create instances of StatePtr from Python") # <<<<<<<<<<<<<<
9721  *
9722  * def __repr__(self):
9723  */
9724  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_instances_of_State); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9725  __Pyx_GOTREF(__pyx_tuple__4);
9726  __Pyx_GIVEREF(__pyx_tuple__4);
9727 
9728  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
9729  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
9730  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
9731  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
9732  *
9733  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
9734  */
9735  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9736  __Pyx_GOTREF(__pyx_tuple__7);
9737  __Pyx_GIVEREF(__pyx_tuple__7);
9738 
9739  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":219
9740  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
9741  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
9742  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
9743  *
9744  * info.buf = PyArray_DATA(self)
9745  */
9746  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9747  __Pyx_GOTREF(__pyx_tuple__8);
9748  __Pyx_GIVEREF(__pyx_tuple__8);
9749 
9750  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
9751  * if ((descr.byteorder == c'>' and little_endian) or
9752  * (descr.byteorder == c'<' and not little_endian)):
9753  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
9754  * if t == NPY_BYTE: f = "b"
9755  * elif t == NPY_UBYTE: f = "B"
9756  */
9757  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9758  __Pyx_GOTREF(__pyx_tuple__9);
9759  __Pyx_GIVEREF(__pyx_tuple__9);
9760 
9761  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":799
9762  *
9763  * if (end - f) - <int>(new_offset - offset[0]) < 15:
9764  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
9765  *
9766  * if ((child.byteorder == c'>' and little_endian) or
9767  */
9768  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9769  __Pyx_GOTREF(__pyx_tuple__10);
9770  __Pyx_GIVEREF(__pyx_tuple__10);
9771 
9772  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":803
9773  * if ((child.byteorder == c'>' and little_endian) or
9774  * (child.byteorder == c'<' and not little_endian)):
9775  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
9776  * # One could encode it in the format string and have Cython
9777  * # complain instead, BUT: < and > in format strings also imply
9778  */
9779  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9780  __Pyx_GOTREF(__pyx_tuple__11);
9781  __Pyx_GIVEREF(__pyx_tuple__11);
9782 
9783  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":823
9784  * t = child.type_num
9785  * if end - f < 5:
9786  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
9787  *
9788  * # Until ticket #99 is fixed, use integers to avoid warnings
9789  */
9790  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9791  __Pyx_GOTREF(__pyx_tuple__12);
9792  __Pyx_GIVEREF(__pyx_tuple__12);
9793 
9794  /* "freenect.pyx":225
9795  * tilt_status = property(_get_tilt_status)
9796  *
9797  * def set_depth_mode(DevPtr dev, int res, int mode): # <<<<<<<<<<<<<<
9798  * return freenect_set_depth_mode(dev._ptr, freenect_find_depth_mode(res, mode))
9799  *
9800  */
9801  __pyx_tuple__13 = PyTuple_Pack(3, __pyx_n_s_dev, __pyx_n_s_res, __pyx_n_s_mode); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9802  __Pyx_GOTREF(__pyx_tuple__13);
9803  __Pyx_GIVEREF(__pyx_tuple__13);
9804  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_set_depth_mode, 225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9805 
9806  /* "freenect.pyx":228
9807  * return freenect_set_depth_mode(dev._ptr, freenect_find_depth_mode(res, mode))
9808  *
9809  * def set_video_mode(DevPtr dev, int res, int mode): # <<<<<<<<<<<<<<
9810  * return freenect_set_video_mode(dev._ptr, freenect_find_video_mode(res, mode))
9811  *
9812  */
9813  __pyx_tuple__15 = PyTuple_Pack(3, __pyx_n_s_dev, __pyx_n_s_res, __pyx_n_s_mode); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9814  __Pyx_GOTREF(__pyx_tuple__15);
9815  __Pyx_GIVEREF(__pyx_tuple__15);
9816  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_set_video_mode, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9817 
9818  /* "freenect.pyx":231
9819  * return freenect_set_video_mode(dev._ptr, freenect_find_video_mode(res, mode))
9820  *
9821  * def get_depth_format(DevPtr dev): # <<<<<<<<<<<<<<
9822  * return freenect_get_current_depth_mode(dev._ptr).video_format
9823  *
9824  */
9825  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_dev); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9826  __Pyx_GOTREF(__pyx_tuple__17);
9827  __Pyx_GIVEREF(__pyx_tuple__17);
9828  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_get_depth_format, 231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9829 
9830  /* "freenect.pyx":234
9831  * return freenect_get_current_depth_mode(dev._ptr).video_format
9832  *
9833  * def get_video_format(DevPtr dev): # <<<<<<<<<<<<<<
9834  * return freenect_get_current_video_mode(dev._ptr).video_format
9835  *
9836  */
9837  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_dev); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9838  __Pyx_GOTREF(__pyx_tuple__19);
9839  __Pyx_GIVEREF(__pyx_tuple__19);
9840  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_get_video_format, 234, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9841 
9842  /* "freenect.pyx":237
9843  * return freenect_get_current_video_mode(dev._ptr).video_format
9844  *
9845  * def start_depth(DevPtr dev): # <<<<<<<<<<<<<<
9846  * return freenect_start_depth(dev._ptr)
9847  *
9848  */
9849  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_dev); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9850  __Pyx_GOTREF(__pyx_tuple__21);
9851  __Pyx_GIVEREF(__pyx_tuple__21);
9852  __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_start_depth, 237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9853 
9854  /* "freenect.pyx":240
9855  * return freenect_start_depth(dev._ptr)
9856  *
9857  * def start_video(DevPtr dev): # <<<<<<<<<<<<<<
9858  * return freenect_start_video(dev._ptr)
9859  *
9860  */
9861  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_dev); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9862  __Pyx_GOTREF(__pyx_tuple__23);
9863  __Pyx_GIVEREF(__pyx_tuple__23);
9864  __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_start_video, 240, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9865 
9866  /* "freenect.pyx":243
9867  * return freenect_start_video(dev._ptr)
9868  *
9869  * def stop_depth(DevPtr dev): # <<<<<<<<<<<<<<
9870  * return freenect_stop_depth(dev._ptr)
9871  *
9872  */
9873  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_dev); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9874  __Pyx_GOTREF(__pyx_tuple__25);
9875  __Pyx_GIVEREF(__pyx_tuple__25);
9876  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_stop_depth, 243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9877 
9878  /* "freenect.pyx":246
9879  * return freenect_stop_depth(dev._ptr)
9880  *
9881  * def stop_video(DevPtr dev): # <<<<<<<<<<<<<<
9882  * return freenect_stop_video(dev._ptr)
9883  *
9884  */
9885  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_dev); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9886  __Pyx_GOTREF(__pyx_tuple__27);
9887  __Pyx_GIVEREF(__pyx_tuple__27);
9888  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_stop_video, 246, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9889 
9890  /* "freenect.pyx":249
9891  * return freenect_stop_video(dev._ptr)
9892  *
9893  * def shutdown(CtxPtr ctx): # <<<<<<<<<<<<<<
9894  * return freenect_shutdown(ctx._ptr)
9895  *
9896  */
9897  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9898  __Pyx_GOTREF(__pyx_tuple__29);
9899  __Pyx_GIVEREF(__pyx_tuple__29);
9900  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_shutdown, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9901 
9902  /* "freenect.pyx":252
9903  * return freenect_shutdown(ctx._ptr)
9904  *
9905  * def process_events(CtxPtr ctx): # <<<<<<<<<<<<<<
9906  * return freenect_process_events(ctx._ptr)
9907  *
9908  */
9909  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9910  __Pyx_GOTREF(__pyx_tuple__31);
9911  __Pyx_GIVEREF(__pyx_tuple__31);
9912  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_process_events, 252, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9913 
9914  /* "freenect.pyx":255
9915  * return freenect_process_events(ctx._ptr)
9916  *
9917  * def num_devices(CtxPtr ctx): # <<<<<<<<<<<<<<
9918  * return freenect_num_devices(ctx._ptr)
9919  *
9920  */
9921  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9922  __Pyx_GOTREF(__pyx_tuple__33);
9923  __Pyx_GIVEREF(__pyx_tuple__33);
9924  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_num_devices, 255, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9925 
9926  /* "freenect.pyx":258
9927  * return freenect_num_devices(ctx._ptr)
9928  *
9929  * def close_device(DevPtr dev): # <<<<<<<<<<<<<<
9930  * return freenect_close_device(dev._ptr)
9931  *
9932  */
9933  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_n_s_dev); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9934  __Pyx_GOTREF(__pyx_tuple__35);
9935  __Pyx_GIVEREF(__pyx_tuple__35);
9936  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_close_device, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9937 
9938  /* "freenect.pyx":261
9939  * return freenect_close_device(dev._ptr)
9940  *
9941  * def set_tilt_degs(DevPtr dev, float angle): # <<<<<<<<<<<<<<
9942  * freenect_set_tilt_degs(dev._ptr, angle)
9943  *
9944  */
9945  __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_s_dev, __pyx_n_s_angle); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9946  __Pyx_GOTREF(__pyx_tuple__37);
9947  __Pyx_GIVEREF(__pyx_tuple__37);
9948  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_set_tilt_degs, 261, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9949 
9950  /* "freenect.pyx":264
9951  * freenect_set_tilt_degs(dev._ptr, angle)
9952  *
9953  * def set_led(DevPtr dev, freenect_led_options option): # <<<<<<<<<<<<<<
9954  * return freenect_set_led(dev._ptr, option)
9955  *
9956  */
9957  __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_dev, __pyx_n_s_option); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9958  __Pyx_GOTREF(__pyx_tuple__39);
9959  __Pyx_GIVEREF(__pyx_tuple__39);
9960  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_set_led, 264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9961 
9962  /* "freenect.pyx":267
9963  * return freenect_set_led(dev._ptr, option)
9964  *
9965  * def update_tilt_state(DevPtr dev): # <<<<<<<<<<<<<<
9966  * return freenect_update_tilt_state(dev._ptr)
9967  *
9968  */
9969  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_dev); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9970  __Pyx_GOTREF(__pyx_tuple__41);
9971  __Pyx_GIVEREF(__pyx_tuple__41);
9972  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_update_tilt_state, 267, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9973 
9974  /* "freenect.pyx":270
9975  * return freenect_update_tilt_state(dev._ptr)
9976  *
9977  * def get_tilt_state(DevPtr dev): # <<<<<<<<<<<<<<
9978  * cdef freenect_raw_tilt_state* state = freenect_get_tilt_state(dev._ptr)
9979  * cdef StatePtr state_out = StatePtr.__new__(StatePtr)
9980  */
9981  __pyx_tuple__43 = PyTuple_Pack(3, __pyx_n_s_dev, __pyx_n_s_state, __pyx_n_s_state_out); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9982  __Pyx_GOTREF(__pyx_tuple__43);
9983  __Pyx_GIVEREF(__pyx_tuple__43);
9984  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_get_tilt_state, 270, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9985 
9986  /* "freenect.pyx":276
9987  * return state_out
9988  *
9989  * def get_mks_accel(StatePtr state): # <<<<<<<<<<<<<<
9990  * cdef double x, y, z
9991  * freenect_get_mks_accel(state._ptr, &x, &y, &z)
9992  */
9993  __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_s_state, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9994  __Pyx_GOTREF(__pyx_tuple__45);
9995  __Pyx_GIVEREF(__pyx_tuple__45);
9996  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_get_mks_accel, 276, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9997 
9998  /* "freenect.pyx":281
9999  * return x, y, z
10000  *
10001  * def get_accel(DevPtr dev): # <<<<<<<<<<<<<<
10002  * """MKS Accelerometer helper
10003  *
10004  */
10005  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_dev); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10006  __Pyx_GOTREF(__pyx_tuple__47);
10007  __Pyx_GIVEREF(__pyx_tuple__47);
10008  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_get_accel, 281, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10009 
10010  /* "freenect.pyx":294
10011  *
10012  *
10013  * def get_tilt_degs(StatePtr state): # <<<<<<<<<<<<<<
10014  * return freenect_get_tilt_degs(state._ptr)
10015  *
10016  */
10017  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10018  __Pyx_GOTREF(__pyx_tuple__49);
10019  __Pyx_GIVEREF(__pyx_tuple__49);
10020  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_get_tilt_degs, 294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10021 
10022  /* "freenect.pyx":298
10023  *
10024  *
10025  * def error_open_device(): # <<<<<<<<<<<<<<
10026  * print("Error: Can't open device. 1.) is it plugged in? 2.) Read the README")
10027  *
10028  */
10029  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_error_open_device, 298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10030 
10031  /* "freenect.pyx":347
10032  * _video_cb(dev_out, pydata, timestamp)
10033  *
10034  * def set_depth_callback(DevPtr dev, cb): # <<<<<<<<<<<<<<
10035  * global _depth_cb
10036  * if cb is not None:
10037  */
10038  __pyx_tuple__52 = PyTuple_Pack(2, __pyx_n_s_dev, __pyx_n_s_cb); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10039  __Pyx_GOTREF(__pyx_tuple__52);
10040  __Pyx_GIVEREF(__pyx_tuple__52);
10041  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_set_depth_callback, 347, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10042 
10043  /* "freenect.pyx":356
10044  * freenect_set_depth_callback(dev._ptr, NULL)
10045  *
10046  * def set_video_callback(DevPtr dev, cb): # <<<<<<<<<<<<<<
10047  * global _video_cb
10048  * if cb is not None:
10049  */
10050  __pyx_tuple__54 = PyTuple_Pack(2, __pyx_n_s_dev, __pyx_n_s_cb); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10051  __Pyx_GOTREF(__pyx_tuple__54);
10052  __Pyx_GIVEREF(__pyx_tuple__54);
10053  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_set_video_callback, 356, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10054 
10055  /* "freenect.pyx":370
10056  *
10057  *
10058  * def runloop(depth=None, video=None, body=None, dev=None): # <<<<<<<<<<<<<<
10059  * """Sets up the kinect and maintains a runloop
10060  *
10061  */
10062  __pyx_tuple__56 = PyTuple_Pack(8, __pyx_n_s_depth, __pyx_n_s_video, __pyx_n_s_body, __pyx_n_s_dev, __pyx_n_s_mdev, __pyx_n_s_ctx, __pyx_n_s_devp, __pyx_n_s_ctxp); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10063  __Pyx_GOTREF(__pyx_tuple__56);
10064  __Pyx_GIVEREF(__pyx_tuple__56);
10065  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_runloop, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10066 
10067  /* "freenect.pyx":434
10068  * freenect_shutdown(ctxp)
10069  *
10070  * def base_runloop(CtxPtr ctx, body=None): # <<<<<<<<<<<<<<
10071  * """Starts a runloop
10072  *
10073  */
10074  __pyx_tuple__58 = PyTuple_Pack(3, __pyx_n_s_ctx, __pyx_n_s_body, __pyx_n_s_ctxp); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10075  __Pyx_GOTREF(__pyx_tuple__58);
10076  __Pyx_GIVEREF(__pyx_tuple__58);
10077  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_base_runloop, 434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10078 
10079  /* "freenect.pyx":485
10080  * return (<char *>data)[:mode.bytes]
10081  *
10082  * def sync_get_depth(index=0, format=DEPTH_11BIT): # <<<<<<<<<<<<<<
10083  * """Get the next available depth frame from the kinect, as a numpy array.
10084  *
10085  */
10086  __pyx_tuple__60 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_format, __pyx_n_s_data, __pyx_n_s_timestamp, __pyx_n_s_dims, __pyx_n_s_out, __pyx_n_s_index_2, __pyx_n_s_format_2); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10087  __Pyx_GOTREF(__pyx_tuple__60);
10088  __Pyx_GIVEREF(__pyx_tuple__60);
10089  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_sync_get_depth, 485, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10090 
10091  /* "freenect.pyx":515
10092  *
10093  *
10094  * def sync_get_video(index=0, format=VIDEO_RGB): # <<<<<<<<<<<<<<
10095  * """Get the next available rgb frame from the kinect, as a numpy array.
10096  *
10097  */
10098  __pyx_tuple__62 = PyTuple_Pack(8, __pyx_n_s_index, __pyx_n_s_format, __pyx_n_s_data, __pyx_n_s_timestamp, __pyx_n_s_dims, __pyx_n_s_out, __pyx_n_s_index_2, __pyx_n_s_format_2); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10099  __Pyx_GOTREF(__pyx_tuple__62);
10100  __Pyx_GIVEREF(__pyx_tuple__62);
10101  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_sync_get_video, 515, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10102 
10103  /* "freenect.pyx":551
10104  *
10105  *
10106  * def sync_stop(): # <<<<<<<<<<<<<<
10107  * """Terminate the synchronous runloop if running, else this is a NOP
10108  * """
10109  */
10110  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_freenect_pyx, __pyx_n_s_sync_stop, 551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10111  __Pyx_RefNannyFinishContext();
10112  return 0;
10113  __pyx_L1_error:;
10114  __Pyx_RefNannyFinishContext();
10115  return -1;
10116 }
10117 
10118 static int __Pyx_InitGlobals(void) {
10119  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
10120  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10121  return 0;
10122  __pyx_L1_error:;
10123  return -1;
10124 }
10125 
10126 #if PY_MAJOR_VERSION < 3
10127 PyMODINIT_FUNC initfreenect(void); /*proto*/
10128 PyMODINIT_FUNC initfreenect(void)
10129 #else
10130 PyMODINIT_FUNC PyInit_freenect(void); /*proto*/
10131 PyMODINIT_FUNC PyInit_freenect(void)
10132 #endif
10133 {
10134  PyObject *__pyx_t_1 = NULL;
10135  PyObject *__pyx_t_2 = NULL;
10136  PyObject *__pyx_t_3 = NULL;
10137  PyObject *__pyx_t_4 = NULL;
10138  int __pyx_lineno = 0;
10139  const char *__pyx_filename = NULL;
10140  int __pyx_clineno = 0;
10141  __Pyx_RefNannyDeclarations
10142  #if CYTHON_REFNANNY
10143  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
10144  if (!__Pyx_RefNanny) {
10145  PyErr_Clear();
10146  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
10147  if (!__Pyx_RefNanny)
10148  Py_FatalError("failed to import 'refnanny' module");
10149  }
10150  #endif
10151  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_freenect(void)", 0);
10152  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10153  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10154  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10155  #ifdef __Pyx_CyFunction_USED
10156  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10157  #endif
10158  #ifdef __Pyx_FusedFunction_USED
10159  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10160  #endif
10161  #ifdef __Pyx_Generator_USED
10162  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10163  #endif
10164  /*--- Library function declarations ---*/
10165  /*--- Threads initialization code ---*/
10166  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
10167  #ifdef WITH_THREAD /* Python build with threading support? */
10168  PyEval_InitThreads();
10169  #endif
10170  #endif
10171  /*--- Module creation code ---*/
10172  #if PY_MAJOR_VERSION < 3
10173  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("freenect"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
10174  #else
10175  __pyx_m = PyModule_Create(&__pyx_moduledef);
10176  #endif
10177  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10178  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10179  Py_INCREF(__pyx_d);
10180  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10181  #if CYTHON_COMPILING_IN_PYPY
10182  Py_INCREF(__pyx_b);
10183  #endif
10184  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
10185  /*--- Initialize various global constants etc. ---*/
10186  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10187  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
10188  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10189  #endif
10190  if (__pyx_module_is_main_freenect) {
10191  if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
10192  }
10193  #if PY_MAJOR_VERSION >= 3
10194  {
10195  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10196  if (!PyDict_GetItemString(modules, "freenect")) {
10197  if (unlikely(PyDict_SetItemString(modules, "freenect", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10198  }
10199  }
10200  #endif
10201  /*--- Builtin init code ---*/
10202  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10203  /*--- Constants init code ---*/
10204  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10205  /*--- Global init code ---*/
10206  /*--- Variable export code ---*/
10207  /*--- Function export code ---*/
10208  /*--- Type init code ---*/
10209  if (PyType_Ready(&__pyx_type_8freenect_CtxPtr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10210  __pyx_type_8freenect_CtxPtr.tp_print = 0;
10211  if (__Pyx_SetAttrString(__pyx_m, "CtxPtr", (PyObject *)&__pyx_type_8freenect_CtxPtr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10212  __pyx_ptype_8freenect_CtxPtr = &__pyx_type_8freenect_CtxPtr;
10213  if (PyType_Ready(&__pyx_type_8freenect_DevPtr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10214  __pyx_type_8freenect_DevPtr.tp_print = 0;
10215  if (__Pyx_SetAttrString(__pyx_m, "DevPtr", (PyObject *)&__pyx_type_8freenect_DevPtr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10216  __pyx_ptype_8freenect_DevPtr = &__pyx_type_8freenect_DevPtr;
10217  if (PyType_Ready(&__pyx_type_8freenect_StatePtr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10218  __pyx_type_8freenect_StatePtr.tp_print = 0;
10219  if (__Pyx_SetAttrString(__pyx_m, "StatePtr", (PyObject *)&__pyx_type_8freenect_StatePtr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10220  __pyx_ptype_8freenect_StatePtr = &__pyx_type_8freenect_StatePtr;
10221  /*--- Type import code ---*/
10222  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
10223  #if CYTHON_COMPILING_IN_PYPY
10224  sizeof(PyTypeObject),
10225  #else
10226  sizeof(PyHeapTypeObject),
10227  #endif
10228  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10229  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10230  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10231  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10232  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10233  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10234  /*--- Variable import code ---*/
10235  /*--- Function import code ---*/
10236  /*--- Execution code ---*/
10237 
10238  /* "freenect.pyx":26
10239  *
10240  * from libc.stdint cimport *
10241  * import numpy as np # <<<<<<<<<<<<<<
10242  * cimport numpy as npc
10243  *
10244  */
10245  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10246  __Pyx_GOTREF(__pyx_t_1);
10247  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10248  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10249 
10250  /* "freenect.pyx":142
10251  *
10252  *
10253  * VIDEO_RGB = FREENECT_VIDEO_RGB # <<<<<<<<<<<<<<
10254  * VIDEO_BAYER = FREENECT_VIDEO_BAYER
10255  * VIDEO_IR_8BIT = FREENECT_VIDEO_IR_8BIT
10256  */
10257  __pyx_t_1 = PyInt_FromLong(FREENECT_VIDEO_RGB); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10258  __Pyx_GOTREF(__pyx_t_1);
10259  if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEO_RGB, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10260  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10261 
10262  /* "freenect.pyx":143
10263  *
10264  * VIDEO_RGB = FREENECT_VIDEO_RGB
10265  * VIDEO_BAYER = FREENECT_VIDEO_BAYER # <<<<<<<<<<<<<<
10266  * VIDEO_IR_8BIT = FREENECT_VIDEO_IR_8BIT
10267  * VIDEO_IR_10BIT = FREENECT_VIDEO_IR_10BIT
10268  */
10269  __pyx_t_1 = PyInt_FromLong(FREENECT_VIDEO_BAYER); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10270  __Pyx_GOTREF(__pyx_t_1);
10271  if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEO_BAYER, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10272  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10273 
10274  /* "freenect.pyx":144
10275  * VIDEO_RGB = FREENECT_VIDEO_RGB
10276  * VIDEO_BAYER = FREENECT_VIDEO_BAYER
10277  * VIDEO_IR_8BIT = FREENECT_VIDEO_IR_8BIT # <<<<<<<<<<<<<<
10278  * VIDEO_IR_10BIT = FREENECT_VIDEO_IR_10BIT
10279  * VIDEO_IR_10BIT_PACKED = FREENECT_VIDEO_IR_10BIT_PACKED
10280  */
10281  __pyx_t_1 = PyInt_FromLong(FREENECT_VIDEO_IR_8BIT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10282  __Pyx_GOTREF(__pyx_t_1);
10283  if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEO_IR_8BIT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10284  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10285 
10286  /* "freenect.pyx":145
10287  * VIDEO_BAYER = FREENECT_VIDEO_BAYER
10288  * VIDEO_IR_8BIT = FREENECT_VIDEO_IR_8BIT
10289  * VIDEO_IR_10BIT = FREENECT_VIDEO_IR_10BIT # <<<<<<<<<<<<<<
10290  * VIDEO_IR_10BIT_PACKED = FREENECT_VIDEO_IR_10BIT_PACKED
10291  * VIDEO_YUV_RGB = FREENECT_VIDEO_YUV_RGB
10292  */
10293  __pyx_t_1 = PyInt_FromLong(FREENECT_VIDEO_IR_10BIT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10294  __Pyx_GOTREF(__pyx_t_1);
10295  if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEO_IR_10BIT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10296  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10297 
10298  /* "freenect.pyx":146
10299  * VIDEO_IR_8BIT = FREENECT_VIDEO_IR_8BIT
10300  * VIDEO_IR_10BIT = FREENECT_VIDEO_IR_10BIT
10301  * VIDEO_IR_10BIT_PACKED = FREENECT_VIDEO_IR_10BIT_PACKED # <<<<<<<<<<<<<<
10302  * VIDEO_YUV_RGB = FREENECT_VIDEO_YUV_RGB
10303  * VIDEO_YUV_RAW = FREENECT_VIDEO_YUV_RAW
10304  */
10305  __pyx_t_1 = PyInt_FromLong(FREENECT_VIDEO_IR_10BIT_PACKED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10306  __Pyx_GOTREF(__pyx_t_1);
10307  if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEO_IR_10BIT_PACKED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10308  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10309 
10310  /* "freenect.pyx":147
10311  * VIDEO_IR_10BIT = FREENECT_VIDEO_IR_10BIT
10312  * VIDEO_IR_10BIT_PACKED = FREENECT_VIDEO_IR_10BIT_PACKED
10313  * VIDEO_YUV_RGB = FREENECT_VIDEO_YUV_RGB # <<<<<<<<<<<<<<
10314  * VIDEO_YUV_RAW = FREENECT_VIDEO_YUV_RAW
10315  * DEPTH_11BIT = FREENECT_DEPTH_11BIT
10316  */
10317  __pyx_t_1 = PyInt_FromLong(FREENECT_VIDEO_YUV_RGB); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10318  __Pyx_GOTREF(__pyx_t_1);
10319  if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEO_YUV_RGB, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10320  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10321 
10322  /* "freenect.pyx":148
10323  * VIDEO_IR_10BIT_PACKED = FREENECT_VIDEO_IR_10BIT_PACKED
10324  * VIDEO_YUV_RGB = FREENECT_VIDEO_YUV_RGB
10325  * VIDEO_YUV_RAW = FREENECT_VIDEO_YUV_RAW # <<<<<<<<<<<<<<
10326  * DEPTH_11BIT = FREENECT_DEPTH_11BIT
10327  * DEPTH_10BIT = FREENECT_DEPTH_10BIT
10328  */
10329  __pyx_t_1 = PyInt_FromLong(FREENECT_VIDEO_YUV_RAW); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10330  __Pyx_GOTREF(__pyx_t_1);
10331  if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEO_YUV_RAW, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10332  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10333 
10334  /* "freenect.pyx":149
10335  * VIDEO_YUV_RGB = FREENECT_VIDEO_YUV_RGB
10336  * VIDEO_YUV_RAW = FREENECT_VIDEO_YUV_RAW
10337  * DEPTH_11BIT = FREENECT_DEPTH_11BIT # <<<<<<<<<<<<<<
10338  * DEPTH_10BIT = FREENECT_DEPTH_10BIT
10339  * DEPTH_11BIT_PACKED = FREENECT_DEPTH_11BIT_PACKED
10340  */
10341  __pyx_t_1 = PyInt_FromLong(FREENECT_DEPTH_11BIT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10342  __Pyx_GOTREF(__pyx_t_1);
10343  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEPTH_11BIT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10344  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10345 
10346  /* "freenect.pyx":150
10347  * VIDEO_YUV_RAW = FREENECT_VIDEO_YUV_RAW
10348  * DEPTH_11BIT = FREENECT_DEPTH_11BIT
10349  * DEPTH_10BIT = FREENECT_DEPTH_10BIT # <<<<<<<<<<<<<<
10350  * DEPTH_11BIT_PACKED = FREENECT_DEPTH_11BIT_PACKED
10351  * DEPTH_10BIT_PACKED = FREENECT_DEPTH_10BIT_PACKED
10352  */
10353  __pyx_t_1 = PyInt_FromLong(FREENECT_DEPTH_10BIT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10354  __Pyx_GOTREF(__pyx_t_1);
10355  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEPTH_10BIT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10356  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10357 
10358  /* "freenect.pyx":151
10359  * DEPTH_11BIT = FREENECT_DEPTH_11BIT
10360  * DEPTH_10BIT = FREENECT_DEPTH_10BIT
10361  * DEPTH_11BIT_PACKED = FREENECT_DEPTH_11BIT_PACKED # <<<<<<<<<<<<<<
10362  * DEPTH_10BIT_PACKED = FREENECT_DEPTH_10BIT_PACKED
10363  * DEPTH_REGISTERED = FREENECT_DEPTH_REGISTERED
10364  */
10365  __pyx_t_1 = PyInt_FromLong(FREENECT_DEPTH_11BIT_PACKED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10366  __Pyx_GOTREF(__pyx_t_1);
10367  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEPTH_11BIT_PACKED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10368  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10369 
10370  /* "freenect.pyx":152
10371  * DEPTH_10BIT = FREENECT_DEPTH_10BIT
10372  * DEPTH_11BIT_PACKED = FREENECT_DEPTH_11BIT_PACKED
10373  * DEPTH_10BIT_PACKED = FREENECT_DEPTH_10BIT_PACKED # <<<<<<<<<<<<<<
10374  * DEPTH_REGISTERED = FREENECT_DEPTH_REGISTERED
10375  * DEPTH_MM = FREENECT_DEPTH_MM
10376  */
10377  __pyx_t_1 = PyInt_FromLong(FREENECT_DEPTH_10BIT_PACKED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10378  __Pyx_GOTREF(__pyx_t_1);
10379  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEPTH_10BIT_PACKED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10380  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10381 
10382  /* "freenect.pyx":153
10383  * DEPTH_11BIT_PACKED = FREENECT_DEPTH_11BIT_PACKED
10384  * DEPTH_10BIT_PACKED = FREENECT_DEPTH_10BIT_PACKED
10385  * DEPTH_REGISTERED = FREENECT_DEPTH_REGISTERED # <<<<<<<<<<<<<<
10386  * DEPTH_MM = FREENECT_DEPTH_MM
10387  * LED_OFF = FREENECT_LED_OFF
10388  */
10389  __pyx_t_1 = PyInt_FromLong(FREENECT_DEPTH_REGISTERED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10390  __Pyx_GOTREF(__pyx_t_1);
10391  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEPTH_REGISTERED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10392  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10393 
10394  /* "freenect.pyx":154
10395  * DEPTH_10BIT_PACKED = FREENECT_DEPTH_10BIT_PACKED
10396  * DEPTH_REGISTERED = FREENECT_DEPTH_REGISTERED
10397  * DEPTH_MM = FREENECT_DEPTH_MM # <<<<<<<<<<<<<<
10398  * LED_OFF = FREENECT_LED_OFF
10399  * LED_GREEN = FREENECT_LED_GREEN
10400  */
10401  __pyx_t_1 = PyInt_FromLong(FREENECT_DEPTH_MM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10402  __Pyx_GOTREF(__pyx_t_1);
10403  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEPTH_MM, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10404  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10405 
10406  /* "freenect.pyx":155
10407  * DEPTH_REGISTERED = FREENECT_DEPTH_REGISTERED
10408  * DEPTH_MM = FREENECT_DEPTH_MM
10409  * LED_OFF = FREENECT_LED_OFF # <<<<<<<<<<<<<<
10410  * LED_GREEN = FREENECT_LED_GREEN
10411  * LED_RED = FREENECT_LED_RED
10412  */
10413  __pyx_t_1 = PyInt_FromLong(LED_OFF); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10414  __Pyx_GOTREF(__pyx_t_1);
10415  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LED_OFF, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10416  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10417 
10418  /* "freenect.pyx":156
10419  * DEPTH_MM = FREENECT_DEPTH_MM
10420  * LED_OFF = FREENECT_LED_OFF
10421  * LED_GREEN = FREENECT_LED_GREEN # <<<<<<<<<<<<<<
10422  * LED_RED = FREENECT_LED_RED
10423  * LED_YELLOW = FREENECT_LED_YELLOW
10424  */
10425  __pyx_t_1 = PyInt_FromLong(LED_GREEN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10426  __Pyx_GOTREF(__pyx_t_1);
10427  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LED_GREEN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10428  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10429 
10430  /* "freenect.pyx":157
10431  * LED_OFF = FREENECT_LED_OFF
10432  * LED_GREEN = FREENECT_LED_GREEN
10433  * LED_RED = FREENECT_LED_RED # <<<<<<<<<<<<<<
10434  * LED_YELLOW = FREENECT_LED_YELLOW
10435  * LED_BLINK_GREEN = FREENECT_LED_BLINK_GREEN
10436  */
10437  __pyx_t_1 = PyInt_FromLong(LED_RED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10438  __Pyx_GOTREF(__pyx_t_1);
10439  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LED_RED, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10440  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10441 
10442  /* "freenect.pyx":158
10443  * LED_GREEN = FREENECT_LED_GREEN
10444  * LED_RED = FREENECT_LED_RED
10445  * LED_YELLOW = FREENECT_LED_YELLOW # <<<<<<<<<<<<<<
10446  * LED_BLINK_GREEN = FREENECT_LED_BLINK_GREEN
10447  * LED_BLINK_RED_YELLOW = FREENECT_LED_BLINK_RED_YELLOW
10448  */
10449  __pyx_t_1 = PyInt_FromLong(LED_YELLOW); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10450  __Pyx_GOTREF(__pyx_t_1);
10451  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LED_YELLOW, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10452  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10453 
10454  /* "freenect.pyx":159
10455  * LED_RED = FREENECT_LED_RED
10456  * LED_YELLOW = FREENECT_LED_YELLOW
10457  * LED_BLINK_GREEN = FREENECT_LED_BLINK_GREEN # <<<<<<<<<<<<<<
10458  * LED_BLINK_RED_YELLOW = FREENECT_LED_BLINK_RED_YELLOW
10459  * RESOLUTION_LOW = FREENECT_RESOLUTION_LOW
10460  */
10461  __pyx_t_1 = PyInt_FromLong(LED_BLINK_GREEN); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10462  __Pyx_GOTREF(__pyx_t_1);
10463  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LED_BLINK_GREEN, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10464  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10465 
10466  /* "freenect.pyx":160
10467  * LED_YELLOW = FREENECT_LED_YELLOW
10468  * LED_BLINK_GREEN = FREENECT_LED_BLINK_GREEN
10469  * LED_BLINK_RED_YELLOW = FREENECT_LED_BLINK_RED_YELLOW # <<<<<<<<<<<<<<
10470  * RESOLUTION_LOW = FREENECT_RESOLUTION_LOW
10471  * RESOLUTION_MEDIUM = FREENECT_RESOLUTION_MEDIUM
10472  */
10473  __pyx_t_1 = PyInt_FromLong(LED_BLINK_RED_YELLOW); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10474  __Pyx_GOTREF(__pyx_t_1);
10475  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LED_BLINK_RED_YELLOW, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10476  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10477 
10478  /* "freenect.pyx":161
10479  * LED_BLINK_GREEN = FREENECT_LED_BLINK_GREEN
10480  * LED_BLINK_RED_YELLOW = FREENECT_LED_BLINK_RED_YELLOW
10481  * RESOLUTION_LOW = FREENECT_RESOLUTION_LOW # <<<<<<<<<<<<<<
10482  * RESOLUTION_MEDIUM = FREENECT_RESOLUTION_MEDIUM
10483  * RESOLUTION_HIGH = FREENECT_RESOLUTION_HIGH
10484  */
10485  __pyx_t_1 = PyInt_FromLong(FREENECT_RESOLUTION_LOW); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10486  __Pyx_GOTREF(__pyx_t_1);
10487  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RESOLUTION_LOW, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10488  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10489 
10490  /* "freenect.pyx":162
10491  * LED_BLINK_RED_YELLOW = FREENECT_LED_BLINK_RED_YELLOW
10492  * RESOLUTION_LOW = FREENECT_RESOLUTION_LOW
10493  * RESOLUTION_MEDIUM = FREENECT_RESOLUTION_MEDIUM # <<<<<<<<<<<<<<
10494  * RESOLUTION_HIGH = FREENECT_RESOLUTION_HIGH
10495  * DEVICE_MOTOR = FREENECT_DEVICE_MOTOR
10496  */
10497  __pyx_t_1 = PyInt_FromLong(FREENECT_RESOLUTION_MEDIUM); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10498  __Pyx_GOTREF(__pyx_t_1);
10499  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RESOLUTION_MEDIUM, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10500  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10501 
10502  /* "freenect.pyx":163
10503  * RESOLUTION_LOW = FREENECT_RESOLUTION_LOW
10504  * RESOLUTION_MEDIUM = FREENECT_RESOLUTION_MEDIUM
10505  * RESOLUTION_HIGH = FREENECT_RESOLUTION_HIGH # <<<<<<<<<<<<<<
10506  * DEVICE_MOTOR = FREENECT_DEVICE_MOTOR
10507  * DEVICE_CAMERA = FREENECT_DEVICE_CAMERA
10508  */
10509  __pyx_t_1 = PyInt_FromLong(FREENECT_RESOLUTION_HIGH); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10510  __Pyx_GOTREF(__pyx_t_1);
10511  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RESOLUTION_HIGH, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10512  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10513 
10514  /* "freenect.pyx":164
10515  * RESOLUTION_MEDIUM = FREENECT_RESOLUTION_MEDIUM
10516  * RESOLUTION_HIGH = FREENECT_RESOLUTION_HIGH
10517  * DEVICE_MOTOR = FREENECT_DEVICE_MOTOR # <<<<<<<<<<<<<<
10518  * DEVICE_CAMERA = FREENECT_DEVICE_CAMERA
10519  * DEVICE_AUDIO = FREENECT_DEVICE_AUDIO
10520  */
10521  __pyx_t_1 = PyInt_FromLong(FREENECT_DEVICE_MOTOR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10522  __Pyx_GOTREF(__pyx_t_1);
10523  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEVICE_MOTOR, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10524  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10525 
10526  /* "freenect.pyx":165
10527  * RESOLUTION_HIGH = FREENECT_RESOLUTION_HIGH
10528  * DEVICE_MOTOR = FREENECT_DEVICE_MOTOR
10529  * DEVICE_CAMERA = FREENECT_DEVICE_CAMERA # <<<<<<<<<<<<<<
10530  * DEVICE_AUDIO = FREENECT_DEVICE_AUDIO
10531  *
10532  */
10533  __pyx_t_1 = PyInt_FromLong(FREENECT_DEVICE_CAMERA); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10534  __Pyx_GOTREF(__pyx_t_1);
10535  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEVICE_CAMERA, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10536  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10537 
10538  /* "freenect.pyx":166
10539  * DEVICE_MOTOR = FREENECT_DEVICE_MOTOR
10540  * DEVICE_CAMERA = FREENECT_DEVICE_CAMERA
10541  * DEVICE_AUDIO = FREENECT_DEVICE_AUDIO # <<<<<<<<<<<<<<
10542  *
10543  * cdef inline str _format_ptr(void *ptr):
10544  */
10545  __pyx_t_1 = PyInt_FromLong(FREENECT_DEVICE_AUDIO); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10546  __Pyx_GOTREF(__pyx_t_1);
10547  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEVICE_AUDIO, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10548  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10549 
10550  /* "freenect.pyx":219
10551  * return int(self._ptr.tilt_status)
10552  *
10553  * accelerometer_x = property(_get_accelx) # <<<<<<<<<<<<<<
10554  * accelerometer_y = property(_get_accely)
10555  * accelerometer_z = property(_get_accelz)
10556  */
10557  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_8freenect_StatePtr, __pyx_n_s_get_accelx); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10558  __Pyx_GOTREF(__pyx_t_1);
10559  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10560  __Pyx_GOTREF(__pyx_t_2);
10561  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
10562  __Pyx_GIVEREF(__pyx_t_1);
10563  __pyx_t_1 = 0;
10564  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10565  __Pyx_GOTREF(__pyx_t_1);
10566  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10567  if (PyDict_SetItem((PyObject *)__pyx_ptype_8freenect_StatePtr->tp_dict, __pyx_n_s_accelerometer_x, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10568  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10569  PyType_Modified(__pyx_ptype_8freenect_StatePtr);
10570 
10571  /* "freenect.pyx":220
10572  *
10573  * accelerometer_x = property(_get_accelx)
10574  * accelerometer_y = property(_get_accely) # <<<<<<<<<<<<<<
10575  * accelerometer_z = property(_get_accelz)
10576  * tilt_angle = property(_get_tilt_angle)
10577  */
10578  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_8freenect_StatePtr, __pyx_n_s_get_accely); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10579  __Pyx_GOTREF(__pyx_t_1);
10580  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10581  __Pyx_GOTREF(__pyx_t_2);
10582  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
10583  __Pyx_GIVEREF(__pyx_t_1);
10584  __pyx_t_1 = 0;
10585  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10586  __Pyx_GOTREF(__pyx_t_1);
10587  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10588  if (PyDict_SetItem((PyObject *)__pyx_ptype_8freenect_StatePtr->tp_dict, __pyx_n_s_accelerometer_y, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10589  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10590  PyType_Modified(__pyx_ptype_8freenect_StatePtr);
10591 
10592  /* "freenect.pyx":221
10593  * accelerometer_x = property(_get_accelx)
10594  * accelerometer_y = property(_get_accely)
10595  * accelerometer_z = property(_get_accelz) # <<<<<<<<<<<<<<
10596  * tilt_angle = property(_get_tilt_angle)
10597  * tilt_status = property(_get_tilt_status)
10598  */
10599  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_8freenect_StatePtr, __pyx_n_s_get_accelz); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10600  __Pyx_GOTREF(__pyx_t_1);
10601  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10602  __Pyx_GOTREF(__pyx_t_2);
10603  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
10604  __Pyx_GIVEREF(__pyx_t_1);
10605  __pyx_t_1 = 0;
10606  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10607  __Pyx_GOTREF(__pyx_t_1);
10608  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10609  if (PyDict_SetItem((PyObject *)__pyx_ptype_8freenect_StatePtr->tp_dict, __pyx_n_s_accelerometer_z, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10610  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10611  PyType_Modified(__pyx_ptype_8freenect_StatePtr);
10612 
10613  /* "freenect.pyx":222
10614  * accelerometer_y = property(_get_accely)
10615  * accelerometer_z = property(_get_accelz)
10616  * tilt_angle = property(_get_tilt_angle) # <<<<<<<<<<<<<<
10617  * tilt_status = property(_get_tilt_status)
10618  *
10619  */
10620  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_8freenect_StatePtr, __pyx_n_s_get_tilt_angle); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10621  __Pyx_GOTREF(__pyx_t_1);
10622  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10623  __Pyx_GOTREF(__pyx_t_2);
10624  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
10625  __Pyx_GIVEREF(__pyx_t_1);
10626  __pyx_t_1 = 0;
10627  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10628  __Pyx_GOTREF(__pyx_t_1);
10629  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10630  if (PyDict_SetItem((PyObject *)__pyx_ptype_8freenect_StatePtr->tp_dict, __pyx_n_s_tilt_angle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10631  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10632  PyType_Modified(__pyx_ptype_8freenect_StatePtr);
10633 
10634  /* "freenect.pyx":223
10635  * accelerometer_z = property(_get_accelz)
10636  * tilt_angle = property(_get_tilt_angle)
10637  * tilt_status = property(_get_tilt_status) # <<<<<<<<<<<<<<
10638  *
10639  * def set_depth_mode(DevPtr dev, int res, int mode):
10640  */
10641  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_8freenect_StatePtr, __pyx_n_s_get_tilt_status); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10642  __Pyx_GOTREF(__pyx_t_1);
10643  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10644  __Pyx_GOTREF(__pyx_t_2);
10645  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
10646  __Pyx_GIVEREF(__pyx_t_1);
10647  __pyx_t_1 = 0;
10648  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10649  __Pyx_GOTREF(__pyx_t_1);
10650  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10651  if (PyDict_SetItem((PyObject *)__pyx_ptype_8freenect_StatePtr->tp_dict, __pyx_n_s_tilt_status, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10652  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10653  PyType_Modified(__pyx_ptype_8freenect_StatePtr);
10654 
10655  /* "freenect.pyx":225
10656  * tilt_status = property(_get_tilt_status)
10657  *
10658  * def set_depth_mode(DevPtr dev, int res, int mode): # <<<<<<<<<<<<<<
10659  * return freenect_set_depth_mode(dev._ptr, freenect_find_depth_mode(res, mode))
10660  *
10661  */
10662  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_1set_depth_mode, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10663  __Pyx_GOTREF(__pyx_t_1);
10664  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_depth_mode, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10665  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10666 
10667  /* "freenect.pyx":228
10668  * return freenect_set_depth_mode(dev._ptr, freenect_find_depth_mode(res, mode))
10669  *
10670  * def set_video_mode(DevPtr dev, int res, int mode): # <<<<<<<<<<<<<<
10671  * return freenect_set_video_mode(dev._ptr, freenect_find_video_mode(res, mode))
10672  *
10673  */
10674  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_3set_video_mode, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10675  __Pyx_GOTREF(__pyx_t_1);
10676  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_video_mode, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10677  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10678 
10679  /* "freenect.pyx":231
10680  * return freenect_set_video_mode(dev._ptr, freenect_find_video_mode(res, mode))
10681  *
10682  * def get_depth_format(DevPtr dev): # <<<<<<<<<<<<<<
10683  * return freenect_get_current_depth_mode(dev._ptr).video_format
10684  *
10685  */
10686  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_5get_depth_format, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10687  __Pyx_GOTREF(__pyx_t_1);
10688  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_depth_format, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10689  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10690 
10691  /* "freenect.pyx":234
10692  * return freenect_get_current_depth_mode(dev._ptr).video_format
10693  *
10694  * def get_video_format(DevPtr dev): # <<<<<<<<<<<<<<
10695  * return freenect_get_current_video_mode(dev._ptr).video_format
10696  *
10697  */
10698  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_7get_video_format, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10699  __Pyx_GOTREF(__pyx_t_1);
10700  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_video_format, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10701  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10702 
10703  /* "freenect.pyx":237
10704  * return freenect_get_current_video_mode(dev._ptr).video_format
10705  *
10706  * def start_depth(DevPtr dev): # <<<<<<<<<<<<<<
10707  * return freenect_start_depth(dev._ptr)
10708  *
10709  */
10710  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_9start_depth, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10711  __Pyx_GOTREF(__pyx_t_1);
10712  if (PyDict_SetItem(__pyx_d, __pyx_n_s_start_depth, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10713  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10714 
10715  /* "freenect.pyx":240
10716  * return freenect_start_depth(dev._ptr)
10717  *
10718  * def start_video(DevPtr dev): # <<<<<<<<<<<<<<
10719  * return freenect_start_video(dev._ptr)
10720  *
10721  */
10722  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_11start_video, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10723  __Pyx_GOTREF(__pyx_t_1);
10724  if (PyDict_SetItem(__pyx_d, __pyx_n_s_start_video, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10725  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10726 
10727  /* "freenect.pyx":243
10728  * return freenect_start_video(dev._ptr)
10729  *
10730  * def stop_depth(DevPtr dev): # <<<<<<<<<<<<<<
10731  * return freenect_stop_depth(dev._ptr)
10732  *
10733  */
10734  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_13stop_depth, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10735  __Pyx_GOTREF(__pyx_t_1);
10736  if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop_depth, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10737  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10738 
10739  /* "freenect.pyx":246
10740  * return freenect_stop_depth(dev._ptr)
10741  *
10742  * def stop_video(DevPtr dev): # <<<<<<<<<<<<<<
10743  * return freenect_stop_video(dev._ptr)
10744  *
10745  */
10746  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_15stop_video, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10747  __Pyx_GOTREF(__pyx_t_1);
10748  if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop_video, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10749  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10750 
10751  /* "freenect.pyx":249
10752  * return freenect_stop_video(dev._ptr)
10753  *
10754  * def shutdown(CtxPtr ctx): # <<<<<<<<<<<<<<
10755  * return freenect_shutdown(ctx._ptr)
10756  *
10757  */
10758  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_17shutdown, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10759  __Pyx_GOTREF(__pyx_t_1);
10760  if (PyDict_SetItem(__pyx_d, __pyx_n_s_shutdown, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10761  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10762 
10763  /* "freenect.pyx":252
10764  * return freenect_shutdown(ctx._ptr)
10765  *
10766  * def process_events(CtxPtr ctx): # <<<<<<<<<<<<<<
10767  * return freenect_process_events(ctx._ptr)
10768  *
10769  */
10770  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_19process_events, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10771  __Pyx_GOTREF(__pyx_t_1);
10772  if (PyDict_SetItem(__pyx_d, __pyx_n_s_process_events, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10773  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10774 
10775  /* "freenect.pyx":255
10776  * return freenect_process_events(ctx._ptr)
10777  *
10778  * def num_devices(CtxPtr ctx): # <<<<<<<<<<<<<<
10779  * return freenect_num_devices(ctx._ptr)
10780  *
10781  */
10782  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_21num_devices, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10783  __Pyx_GOTREF(__pyx_t_1);
10784  if (PyDict_SetItem(__pyx_d, __pyx_n_s_num_devices, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10785  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10786 
10787  /* "freenect.pyx":258
10788  * return freenect_num_devices(ctx._ptr)
10789  *
10790  * def close_device(DevPtr dev): # <<<<<<<<<<<<<<
10791  * return freenect_close_device(dev._ptr)
10792  *
10793  */
10794  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_23close_device, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10795  __Pyx_GOTREF(__pyx_t_1);
10796  if (PyDict_SetItem(__pyx_d, __pyx_n_s_close_device, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10797  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10798 
10799  /* "freenect.pyx":261
10800  * return freenect_close_device(dev._ptr)
10801  *
10802  * def set_tilt_degs(DevPtr dev, float angle): # <<<<<<<<<<<<<<
10803  * freenect_set_tilt_degs(dev._ptr, angle)
10804  *
10805  */
10806  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_25set_tilt_degs, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10807  __Pyx_GOTREF(__pyx_t_1);
10808  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_tilt_degs, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10809  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10810 
10811  /* "freenect.pyx":264
10812  * freenect_set_tilt_degs(dev._ptr, angle)
10813  *
10814  * def set_led(DevPtr dev, freenect_led_options option): # <<<<<<<<<<<<<<
10815  * return freenect_set_led(dev._ptr, option)
10816  *
10817  */
10818  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_27set_led, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10819  __Pyx_GOTREF(__pyx_t_1);
10820  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_led, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10821  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10822 
10823  /* "freenect.pyx":267
10824  * return freenect_set_led(dev._ptr, option)
10825  *
10826  * def update_tilt_state(DevPtr dev): # <<<<<<<<<<<<<<
10827  * return freenect_update_tilt_state(dev._ptr)
10828  *
10829  */
10830  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_29update_tilt_state, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10831  __Pyx_GOTREF(__pyx_t_1);
10832  if (PyDict_SetItem(__pyx_d, __pyx_n_s_update_tilt_state, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10833  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10834 
10835  /* "freenect.pyx":270
10836  * return freenect_update_tilt_state(dev._ptr)
10837  *
10838  * def get_tilt_state(DevPtr dev): # <<<<<<<<<<<<<<
10839  * cdef freenect_raw_tilt_state* state = freenect_get_tilt_state(dev._ptr)
10840  * cdef StatePtr state_out = StatePtr.__new__(StatePtr)
10841  */
10842  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_31get_tilt_state, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10843  __Pyx_GOTREF(__pyx_t_1);
10844  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_tilt_state, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10845  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10846 
10847  /* "freenect.pyx":276
10848  * return state_out
10849  *
10850  * def get_mks_accel(StatePtr state): # <<<<<<<<<<<<<<
10851  * cdef double x, y, z
10852  * freenect_get_mks_accel(state._ptr, &x, &y, &z)
10853  */
10854  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_33get_mks_accel, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10855  __Pyx_GOTREF(__pyx_t_1);
10856  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_mks_accel, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10857  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10858 
10859  /* "freenect.pyx":281
10860  * return x, y, z
10861  *
10862  * def get_accel(DevPtr dev): # <<<<<<<<<<<<<<
10863  * """MKS Accelerometer helper
10864  *
10865  */
10866  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_35get_accel, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10867  __Pyx_GOTREF(__pyx_t_1);
10868  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_accel, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10869  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10870 
10871  /* "freenect.pyx":294
10872  *
10873  *
10874  * def get_tilt_degs(StatePtr state): # <<<<<<<<<<<<<<
10875  * return freenect_get_tilt_degs(state._ptr)
10876  *
10877  */
10878  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_37get_tilt_degs, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10879  __Pyx_GOTREF(__pyx_t_1);
10880  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_tilt_degs, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10881  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10882 
10883  /* "freenect.pyx":298
10884  *
10885  *
10886  * def error_open_device(): # <<<<<<<<<<<<<<
10887  * print("Error: Can't open device. 1.) is it plugged in? 2.) Read the README")
10888  *
10889  */
10890  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8freenect_39error_open_device, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10891  __Pyx_GOTREF(__pyx_t_1);
10892  if (PyDict_SetItem(__pyx_d, __pyx_n_s_error_open_device, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10893  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10894 
10895  /* "freenect.pyx":323
10896  * return dev_out
10897  *
10898  * _depth_cb, _video_cb = None, None # <<<<<<<<<<<<<<
10899  *
10900  * cdef void depth_cb(freenect_device *dev, void *data, uint32_t timestamp) with gil:
10901  */
10902  __pyx_t_1 = Py_None;
10903  __Pyx_INCREF(__pyx_t_1);
10904  __pyx_t_2 = Py_None;
10905  __Pyx_INCREF(__pyx_t_2);
10906  if (PyDict_SetItem(__pyx_d, __pyx_n_s_depth_cb, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10907  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10908  if (PyDict_SetItem(__pyx_d, __pyx_n_s_video_cb, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10909  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10910 
10911  /* "freenect.pyx":347
10912  * _video_cb(dev_out, pydata, timestamp)
10913  *
10914  * def set_depth_callback(DevPtr dev, cb): # <<<<<<<<<<<<<<
10915  * global _depth_cb
10916  * if cb is not None:
10917  */
10918  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8freenect_45set_depth_callback, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10919  __Pyx_GOTREF(__pyx_t_2);
10920  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_depth_callback, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10921  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10922 
10923  /* "freenect.pyx":356
10924  * freenect_set_depth_callback(dev._ptr, NULL)
10925  *
10926  * def set_video_callback(DevPtr dev, cb): # <<<<<<<<<<<<<<
10927  * global _video_cb
10928  * if cb is not None:
10929  */
10930  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8freenect_47set_video_callback, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10931  __Pyx_GOTREF(__pyx_t_2);
10932  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_video_callback, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10933  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10934 
10935  /* "freenect.pyx":366
10936  *
10937  *
10938  * class Kill(Exception): # <<<<<<<<<<<<<<
10939  * """This kills the runloop, raise from the body only"""
10940  *
10941  */
10942  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10943  __Pyx_GOTREF(__pyx_t_2);
10944  __Pyx_INCREF(__pyx_builtin_Exception);
10945  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_Exception);
10946  __Pyx_GIVEREF(__pyx_builtin_Exception);
10947  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10948  __Pyx_GOTREF(__pyx_t_1);
10949  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Kill, __pyx_n_s_Kill, (PyObject *) NULL, __pyx_n_s_freenect, __pyx_kp_s_This_kills_the_runloop_raise_fro); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10950  __Pyx_GOTREF(__pyx_t_3);
10951  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Kill, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10952  __Pyx_GOTREF(__pyx_t_4);
10953  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Kill, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10954  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10955  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10956  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10957  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10958 
10959  /* "freenect.pyx":370
10960  *
10961  *
10962  * def runloop(depth=None, video=None, body=None, dev=None): # <<<<<<<<<<<<<<
10963  * """Sets up the kinect and maintains a runloop
10964  *
10965  */
10966  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8freenect_49runloop, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10967  __Pyx_GOTREF(__pyx_t_2);
10968  if (PyDict_SetItem(__pyx_d, __pyx_n_s_runloop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10969  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10970 
10971  /* "freenect.pyx":434
10972  * freenect_shutdown(ctxp)
10973  *
10974  * def base_runloop(CtxPtr ctx, body=None): # <<<<<<<<<<<<<<
10975  * """Starts a runloop
10976  *
10977  */
10978  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8freenect_51base_runloop, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10979  __Pyx_GOTREF(__pyx_t_2);
10980  if (PyDict_SetItem(__pyx_d, __pyx_n_s_base_runloop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10981  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10982 
10983  /* "freenect.pyx":458
10984  * pass
10985  *
10986  * import_array() # <<<<<<<<<<<<<<
10987  *
10988  * cdef object _depth_cb_np(void *data, freenect_frame_mode *mode):
10989  */
10990  import_array();
10991 
10992  /* "freenect.pyx":485
10993  * return (<char *>data)[:mode.bytes]
10994  *
10995  * def sync_get_depth(index=0, format=DEPTH_11BIT): # <<<<<<<<<<<<<<
10996  * """Get the next available depth frame from the kinect, as a numpy array.
10997  *
10998  */
10999  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DEPTH_11BIT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11000  __Pyx_GOTREF(__pyx_t_2);
11001  __pyx_k__5 = __pyx_t_2;
11002  __Pyx_GIVEREF(__pyx_t_2);
11003  __pyx_t_2 = 0;
11004  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8freenect_53sync_get_depth, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11005  __Pyx_GOTREF(__pyx_t_2);
11006  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sync_get_depth, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11007  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11008 
11009  /* "freenect.pyx":515
11010  *
11011  *
11012  * def sync_get_video(index=0, format=VIDEO_RGB): # <<<<<<<<<<<<<<
11013  * """Get the next available rgb frame from the kinect, as a numpy array.
11014  *
11015  */
11016  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEO_RGB); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11017  __Pyx_GOTREF(__pyx_t_2);
11018  __pyx_k__6 = __pyx_t_2;
11019  __Pyx_GIVEREF(__pyx_t_2);
11020  __pyx_t_2 = 0;
11021  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8freenect_55sync_get_video, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11022  __Pyx_GOTREF(__pyx_t_2);
11023  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sync_get_video, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11024  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11025 
11026  /* "freenect.pyx":551
11027  *
11028  *
11029  * def sync_stop(): # <<<<<<<<<<<<<<
11030  * """Terminate the synchronous runloop if running, else this is a NOP
11031  * """
11032  */
11033  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8freenect_57sync_stop, NULL, __pyx_n_s_freenect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11034  __Pyx_GOTREF(__pyx_t_2);
11035  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sync_stop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11036  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11037 
11038  /* "freenect.pyx":1
11039  * #!/usr/bin/env python # <<<<<<<<<<<<<<
11040  * #
11041  * # Copyright (c) 2010 Brandyn White (bwhite@dappervision.com)
11042  */
11043  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11044  __Pyx_GOTREF(__pyx_t_2);
11045  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11046  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11047 
11048  /* "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":976
11049  * arr.base = baseptr
11050  *
11051  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
11052  * if arr.base is NULL:
11053  * return None
11054  */
11055  goto __pyx_L0;
11056  __pyx_L1_error:;
11057  __Pyx_XDECREF(__pyx_t_1);
11058  __Pyx_XDECREF(__pyx_t_2);
11059  __Pyx_XDECREF(__pyx_t_3);
11060  __Pyx_XDECREF(__pyx_t_4);
11061  if (__pyx_m) {
11062  __Pyx_AddTraceback("init freenect", __pyx_clineno, __pyx_lineno, __pyx_filename);
11063  Py_DECREF(__pyx_m); __pyx_m = 0;
11064  } else if (!PyErr_Occurred()) {
11065  PyErr_SetString(PyExc_ImportError, "init freenect");
11066  }
11067  __pyx_L0:;
11068  __Pyx_RefNannyFinishContext();
11069  #if PY_MAJOR_VERSION < 3
11070  return;
11071  #else
11072  return __pyx_m;
11073  #endif
11074 }
11075 
11076 /* Runtime support code */
11077 #if CYTHON_REFNANNY
11078 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
11079  PyObject *m = NULL, *p = NULL;
11080  void *r = NULL;
11081  m = PyImport_ImportModule((char *)modname);
11082  if (!m) goto end;
11083  p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
11084  if (!p) goto end;
11085  r = PyLong_AsVoidPtr(p);
11086 end:
11087  Py_XDECREF(p);
11088  Py_XDECREF(m);
11089  return (__Pyx_RefNannyAPIStruct *)r;
11090 }
11091 #endif /* CYTHON_REFNANNY */
11092 
11093 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
11094  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
11095  if (unlikely(!result)) {
11096  PyErr_Format(PyExc_NameError,
11097 #if PY_MAJOR_VERSION >= 3
11098  "name '%U' is not defined", name);
11099 #else
11100  "name '%.200s' is not defined", PyString_AS_STRING(name));
11101 #endif
11102  }
11103  return result;
11104 }
11105 
11106 #if CYTHON_COMPILING_IN_CPYTHON
11107 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
11108  PyObject *result;
11109  ternaryfunc call = func->ob_type->tp_call;
11110  if (unlikely(!call))
11111  return PyObject_Call(func, arg, kw);
11112 #if PY_VERSION_HEX >= 0x02060000
11113  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
11114  return NULL;
11115 #endif
11116  result = (*call)(func, arg, kw);
11117 #if PY_VERSION_HEX >= 0x02060000
11118  Py_LeaveRecursiveCall();
11119 #endif
11120  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
11121  PyErr_SetString(
11122  PyExc_SystemError,
11123  "NULL result without error in PyObject_Call");
11124  }
11125  return result;
11126 }
11127 #endif
11128 
11129 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
11130 #if CYTHON_COMPILING_IN_CPYTHON
11131  PyObject *tmp_type, *tmp_value, *tmp_tb;
11132  PyThreadState *tstate = PyThreadState_GET();
11133  tmp_type = tstate->curexc_type;
11134  tmp_value = tstate->curexc_value;
11135  tmp_tb = tstate->curexc_traceback;
11136  tstate->curexc_type = type;
11137  tstate->curexc_value = value;
11138  tstate->curexc_traceback = tb;
11139  Py_XDECREF(tmp_type);
11140  Py_XDECREF(tmp_value);
11141  Py_XDECREF(tmp_tb);
11142 #else
11143  PyErr_Restore(type, value, tb);
11144 #endif
11145 }
11146 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
11147 #if CYTHON_COMPILING_IN_CPYTHON
11148  PyThreadState *tstate = PyThreadState_GET();
11149  *type = tstate->curexc_type;
11150  *value = tstate->curexc_value;
11151  *tb = tstate->curexc_traceback;
11152  tstate->curexc_type = 0;
11153  tstate->curexc_value = 0;
11154  tstate->curexc_traceback = 0;
11155 #else
11156  PyErr_Fetch(type, value, tb);
11157 #endif
11158 }
11159 
11160 #if PY_MAJOR_VERSION < 3
11161 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
11162  CYTHON_UNUSED PyObject *cause) {
11163  Py_XINCREF(type);
11164  if (!value || value == Py_None)
11165  value = NULL;
11166  else
11167  Py_INCREF(value);
11168  if (!tb || tb == Py_None)
11169  tb = NULL;
11170  else {
11171  Py_INCREF(tb);
11172  if (!PyTraceBack_Check(tb)) {
11173  PyErr_SetString(PyExc_TypeError,
11174  "raise: arg 3 must be a traceback or None");
11175  goto raise_error;
11176  }
11177  }
11178  #if PY_VERSION_HEX < 0x02050000
11179  if (PyClass_Check(type)) {
11180  #else
11181  if (PyType_Check(type)) {
11182  #endif
11183 #if CYTHON_COMPILING_IN_PYPY
11184  if (!value) {
11185  Py_INCREF(Py_None);
11186  value = Py_None;
11187  }
11188 #endif
11189  PyErr_NormalizeException(&type, &value, &tb);
11190  } else {
11191  if (value) {
11192  PyErr_SetString(PyExc_TypeError,
11193  "instance exception may not have a separate value");
11194  goto raise_error;
11195  }
11196  value = type;
11197  #if PY_VERSION_HEX < 0x02050000
11198  if (PyInstance_Check(type)) {
11199  type = (PyObject*) ((PyInstanceObject*)type)->in_class;
11200  Py_INCREF(type);
11201  } else {
11202  type = 0;
11203  PyErr_SetString(PyExc_TypeError,
11204  "raise: exception must be an old-style class or instance");
11205  goto raise_error;
11206  }
11207  #else
11208  type = (PyObject*) Py_TYPE(type);
11209  Py_INCREF(type);
11210  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
11211  PyErr_SetString(PyExc_TypeError,
11212  "raise: exception class must be a subclass of BaseException");
11213  goto raise_error;
11214  }
11215  #endif
11216  }
11217  __Pyx_ErrRestore(type, value, tb);
11218  return;
11219 raise_error:
11220  Py_XDECREF(value);
11221  Py_XDECREF(type);
11222  Py_XDECREF(tb);
11223  return;
11224 }
11225 #else /* Python 3+ */
11226 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
11227  PyObject* owned_instance = NULL;
11228  if (tb == Py_None) {
11229  tb = 0;
11230  } else if (tb && !PyTraceBack_Check(tb)) {
11231  PyErr_SetString(PyExc_TypeError,
11232  "raise: arg 3 must be a traceback or None");
11233  goto bad;
11234  }
11235  if (value == Py_None)
11236  value = 0;
11237  if (PyExceptionInstance_Check(type)) {
11238  if (value) {
11239  PyErr_SetString(PyExc_TypeError,
11240  "instance exception may not have a separate value");
11241  goto bad;
11242  }
11243  value = type;
11244  type = (PyObject*) Py_TYPE(value);
11245  } else if (PyExceptionClass_Check(type)) {
11246  PyObject *instance_class = NULL;
11247  if (value && PyExceptionInstance_Check(value)) {
11248  instance_class = (PyObject*) Py_TYPE(value);
11249  if (instance_class != type) {
11250  if (PyObject_IsSubclass(instance_class, type)) {
11251  type = instance_class;
11252  } else {
11253  instance_class = NULL;
11254  }
11255  }
11256  }
11257  if (!instance_class) {
11258  PyObject *args;
11259  if (!value)
11260  args = PyTuple_New(0);
11261  else if (PyTuple_Check(value)) {
11262  Py_INCREF(value);
11263  args = value;
11264  } else
11265  args = PyTuple_Pack(1, value);
11266  if (!args)
11267  goto bad;
11268  owned_instance = PyObject_Call(type, args, NULL);
11269  Py_DECREF(args);
11270  if (!owned_instance)
11271  goto bad;
11272  value = owned_instance;
11273  if (!PyExceptionInstance_Check(value)) {
11274  PyErr_Format(PyExc_TypeError,
11275  "calling %R should have returned an instance of "
11276  "BaseException, not %R",
11277  type, Py_TYPE(value));
11278  goto bad;
11279  }
11280  }
11281  } else {
11282  PyErr_SetString(PyExc_TypeError,
11283  "raise: exception class must be a subclass of BaseException");
11284  goto bad;
11285  }
11286 #if PY_VERSION_HEX >= 0x03030000
11287  if (cause) {
11288 #else
11289  if (cause && cause != Py_None) {
11290 #endif
11291  PyObject *fixed_cause;
11292  if (cause == Py_None) {
11293  fixed_cause = NULL;
11294  } else if (PyExceptionClass_Check(cause)) {
11295  fixed_cause = PyObject_CallObject(cause, NULL);
11296  if (fixed_cause == NULL)
11297  goto bad;
11298  } else if (PyExceptionInstance_Check(cause)) {
11299  fixed_cause = cause;
11300  Py_INCREF(fixed_cause);
11301  } else {
11302  PyErr_SetString(PyExc_TypeError,
11303  "exception causes must derive from "
11304  "BaseException");
11305  goto bad;
11306  }
11307  PyException_SetCause(value, fixed_cause);
11308  }
11309  PyErr_SetObject(type, value);
11310  if (tb) {
11311  PyThreadState *tstate = PyThreadState_GET();
11312  PyObject* tmp_tb = tstate->curexc_traceback;
11313  if (tb != tmp_tb) {
11314  Py_INCREF(tb);
11315  tstate->curexc_traceback = tb;
11316  Py_XDECREF(tmp_tb);
11317  }
11318  }
11319 bad:
11320  Py_XDECREF(owned_instance);
11321  return;
11322 }
11323 #endif
11324 
11325 static void __Pyx_RaiseArgtupleInvalid(
11326  const char* func_name,
11327  int exact,
11328  Py_ssize_t num_min,
11329  Py_ssize_t num_max,
11330  Py_ssize_t num_found)
11331 {
11332  Py_ssize_t num_expected;
11333  const char *more_or_less;
11334  if (num_found < num_min) {
11335  num_expected = num_min;
11336  more_or_less = "at least";
11337  } else {
11338  num_expected = num_max;
11339  more_or_less = "at most";
11340  }
11341  if (exact) {
11342  more_or_less = "exactly";
11343  }
11344  PyErr_Format(PyExc_TypeError,
11345  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
11346  func_name, more_or_less, num_expected,
11347  (num_expected == 1) ? "" : "s", num_found);
11348 }
11349 
11350 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
11351  PyObject *kwdict,
11352  const char* function_name,
11353  int kw_allowed)
11354 {
11355  PyObject* key = 0;
11356  Py_ssize_t pos = 0;
11357 #if CYTHON_COMPILING_IN_PYPY
11358  if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
11359  goto invalid_keyword;
11360  return 1;
11361 #else
11362  while (PyDict_Next(kwdict, &pos, &key, 0)) {
11363  #if PY_MAJOR_VERSION < 3
11364  if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
11365  #endif
11366  if (unlikely(!PyUnicode_Check(key)))
11367  goto invalid_keyword_type;
11368  }
11369  if ((!kw_allowed) && unlikely(key))
11370  goto invalid_keyword;
11371  return 1;
11372 invalid_keyword_type:
11373  PyErr_Format(PyExc_TypeError,
11374  "%.200s() keywords must be strings", function_name);
11375  return 0;
11376 #endif
11377 invalid_keyword:
11378  PyErr_Format(PyExc_TypeError,
11379  #if PY_MAJOR_VERSION < 3
11380  "%.200s() got an unexpected keyword argument '%.200s'",
11381  function_name, PyString_AsString(key));
11382  #else
11383  "%s() got an unexpected keyword argument '%U'",
11384  function_name, key);
11385  #endif
11386  return 0;
11387 }
11388 
11389 static void __Pyx_RaiseDoubleKeywordsError(
11390  const char* func_name,
11391  PyObject* kw_name)
11392 {
11393  PyErr_Format(PyExc_TypeError,
11394  #if PY_MAJOR_VERSION >= 3
11395  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
11396  #else
11397  "%s() got multiple values for keyword argument '%s'", func_name,
11398  PyString_AsString(kw_name));
11399  #endif
11400 }
11401 
11402 static int __Pyx_ParseOptionalKeywords(
11403  PyObject *kwds,
11404  PyObject **argnames[],
11405  PyObject *kwds2,
11406  PyObject *values[],
11407  Py_ssize_t num_pos_args,
11408  const char* function_name)
11409 {
11410  PyObject *key = 0, *value = 0;
11411  Py_ssize_t pos = 0;
11412  PyObject*** name;
11413  PyObject*** first_kw_arg = argnames + num_pos_args;
11414  while (PyDict_Next(kwds, &pos, &key, &value)) {
11415  name = first_kw_arg;
11416  while (*name && (**name != key)) name++;
11417  if (*name) {
11418  values[name-argnames] = value;
11419  continue;
11420  }
11421  name = first_kw_arg;
11422  #if PY_MAJOR_VERSION < 3
11423  if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
11424  while (*name) {
11425  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
11426  && _PyString_Eq(**name, key)) {
11427  values[name-argnames] = value;
11428  break;
11429  }
11430  name++;
11431  }
11432  if (*name) continue;
11433  else {
11434  PyObject*** argname = argnames;
11435  while (argname != first_kw_arg) {
11436  if ((**argname == key) || (
11437  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
11438  && _PyString_Eq(**argname, key))) {
11439  goto arg_passed_twice;
11440  }
11441  argname++;
11442  }
11443  }
11444  } else
11445  #endif
11446  if (likely(PyUnicode_Check(key))) {
11447  while (*name) {
11448  int cmp = (**name == key) ? 0 :
11449  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
11450  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
11451  #endif
11452  PyUnicode_Compare(**name, key);
11453  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
11454  if (cmp == 0) {
11455  values[name-argnames] = value;
11456  break;
11457  }
11458  name++;
11459  }
11460  if (*name) continue;
11461  else {
11462  PyObject*** argname = argnames;
11463  while (argname != first_kw_arg) {
11464  int cmp = (**argname == key) ? 0 :
11465  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
11466  (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
11467  #endif
11468  PyUnicode_Compare(**argname, key);
11469  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
11470  if (cmp == 0) goto arg_passed_twice;
11471  argname++;
11472  }
11473  }
11474  } else
11475  goto invalid_keyword_type;
11476  if (kwds2) {
11477  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
11478  } else {
11479  goto invalid_keyword;
11480  }
11481  }
11482  return 0;
11483 arg_passed_twice:
11484  __Pyx_RaiseDoubleKeywordsError(function_name, key);
11485  goto bad;
11486 invalid_keyword_type:
11487  PyErr_Format(PyExc_TypeError,
11488  "%.200s() keywords must be strings", function_name);
11489  goto bad;
11490 invalid_keyword:
11491  PyErr_Format(PyExc_TypeError,
11492  #if PY_MAJOR_VERSION < 3
11493  "%.200s() got an unexpected keyword argument '%.200s'",
11494  function_name, PyString_AsString(key));
11495  #else
11496  "%s() got an unexpected keyword argument '%U'",
11497  function_name, key);
11498  #endif
11499 bad:
11500  return -1;
11501 }
11502 
11503 static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
11504  PyErr_Format(PyExc_TypeError,
11505  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
11506  name, type->tp_name, Py_TYPE(obj)->tp_name);
11507 }
11508 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
11509  const char *name, int exact)
11510 {
11511  if (unlikely(!type)) {
11512  PyErr_SetString(PyExc_SystemError, "Missing type object");
11513  return 0;
11514  }
11515  if (none_allowed && obj == Py_None) return 1;
11516  else if (exact) {
11517  if (likely(Py_TYPE(obj) == type)) return 1;
11518  #if PY_MAJOR_VERSION == 2
11519  else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
11520  #endif
11521  }
11522  else {
11523  if (likely(PyObject_TypeCheck(obj, type))) return 1;
11524  }
11525  __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
11526  return 0;
11527 }
11528 
11529 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
11530  if (unlikely(!type)) {
11531  PyErr_SetString(PyExc_SystemError, "Missing type object");
11532  return 0;
11533  }
11534  if (likely(PyObject_TypeCheck(obj, type)))
11535  return 1;
11536  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
11537  Py_TYPE(obj)->tp_name, type->tp_name);
11538  return 0;
11539 }
11540 
11541 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
11542  PyObject *result;
11543 #if CYTHON_COMPILING_IN_CPYTHON
11544  result = PyDict_GetItem(__pyx_d, name);
11545  if (result) {
11546  Py_INCREF(result);
11547  } else {
11548 #else
11549  result = PyObject_GetItem(__pyx_d, name);
11550  if (!result) {
11551  PyErr_Clear();
11552 #endif
11553  result = __Pyx_GetBuiltinName(name);
11554  }
11555  return result;
11556 }
11557 
11558 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
11559  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
11560  int full_traceback) {
11561  PyObject *old_exc, *old_val, *old_tb;
11562  PyObject *ctx;
11563  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
11564  if (full_traceback) {
11565  Py_XINCREF(old_exc);
11566  Py_XINCREF(old_val);
11567  Py_XINCREF(old_tb);
11568  __Pyx_ErrRestore(old_exc, old_val, old_tb);
11569  PyErr_PrintEx(1);
11570  }
11571  #if PY_MAJOR_VERSION < 3
11572  ctx = PyString_FromString(name);
11573  #else
11574  ctx = PyUnicode_FromString(name);
11575  #endif
11576  __Pyx_ErrRestore(old_exc, old_val, old_tb);
11577  if (!ctx) {
11578  PyErr_WriteUnraisable(Py_None);
11579  } else {
11580  PyErr_WriteUnraisable(ctx);
11581  Py_DECREF(ctx);
11582  }
11583 }
11584 
11585 static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
11586 #if CYTHON_COMPILING_IN_CPYTHON
11587  PyThreadState *tstate = PyThreadState_GET();
11588  *type = tstate->exc_type;
11589  *value = tstate->exc_value;
11590  *tb = tstate->exc_traceback;
11591  Py_XINCREF(*type);
11592  Py_XINCREF(*value);
11593  Py_XINCREF(*tb);
11594 #else
11595  PyErr_GetExcInfo(type, value, tb);
11596 #endif
11597 }
11598 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
11599 #if CYTHON_COMPILING_IN_CPYTHON
11600  PyObject *tmp_type, *tmp_value, *tmp_tb;
11601  PyThreadState *tstate = PyThreadState_GET();
11602  tmp_type = tstate->exc_type;
11603  tmp_value = tstate->exc_value;
11604  tmp_tb = tstate->exc_traceback;
11605  tstate->exc_type = type;
11606  tstate->exc_value = value;
11607  tstate->exc_traceback = tb;
11608  Py_XDECREF(tmp_type);
11609  Py_XDECREF(tmp_value);
11610  Py_XDECREF(tmp_tb);
11611 #else
11612  PyErr_SetExcInfo(type, value, tb);
11613 #endif
11614 }
11615 
11616 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
11617  PyErr_Format(PyExc_ValueError,
11618  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
11619 }
11620 
11621 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
11622  PyErr_Format(PyExc_ValueError,
11623  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
11624  index, (index == 1) ? "" : "s");
11625 }
11626 
11627 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
11628  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
11629 }
11630 
11631 static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
11632  PyObject *result;
11633  result = __Pyx_PyObject_GetAttrStr(nmspace, name);
11634  if (!result)
11635  result = __Pyx_GetModuleGlobalName(name);
11636  return result;
11637 }
11638 
11639 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
11640  Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
11641  for (i=0; i < nbases; i++) {
11642  PyTypeObject *tmptype;
11643  PyObject *tmp = PyTuple_GET_ITEM(bases, i);
11644  tmptype = Py_TYPE(tmp);
11645 #if PY_MAJOR_VERSION < 3
11646  if (tmptype == &PyClass_Type)
11647  continue;
11648 #endif
11649  if (!metaclass) {
11650  metaclass = tmptype;
11651  continue;
11652  }
11653  if (PyType_IsSubtype(metaclass, tmptype))
11654  continue;
11655  if (PyType_IsSubtype(tmptype, metaclass)) {
11656  metaclass = tmptype;
11657  continue;
11658  }
11659  PyErr_SetString(PyExc_TypeError,
11660  "metaclass conflict: "
11661  "the metaclass of a derived class "
11662  "must be a (non-strict) subclass "
11663  "of the metaclasses of all its bases");
11664  return NULL;
11665  }
11666  if (!metaclass) {
11667 #if PY_MAJOR_VERSION < 3
11668  metaclass = &PyClass_Type;
11669 #else
11670  metaclass = &PyType_Type;
11671 #endif
11672  }
11673  Py_INCREF((PyObject*) metaclass);
11674  return (PyObject*) metaclass;
11675 }
11676 
11677 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
11678  PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
11679  PyObject *ns;
11680  if (metaclass) {
11681  PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
11682  if (prep) {
11683  PyObject *pargs = PyTuple_Pack(2, name, bases);
11684  if (unlikely(!pargs)) {
11685  Py_DECREF(prep);
11686  return NULL;
11687  }
11688  ns = PyObject_Call(prep, pargs, mkw);
11689  Py_DECREF(prep);
11690  Py_DECREF(pargs);
11691  } else {
11692  if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
11693  return NULL;
11694  PyErr_Clear();
11695  ns = PyDict_New();
11696  }
11697  } else {
11698  ns = PyDict_New();
11699  }
11700  if (unlikely(!ns))
11701  return NULL;
11702  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
11703  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
11704  if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
11705  return ns;
11706 bad:
11707  Py_DECREF(ns);
11708  return NULL;
11709 }
11710 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
11711  PyObject *dict, PyObject *mkw,
11712  int calculate_metaclass, int allow_py2_metaclass) {
11713  PyObject *result, *margs;
11714  PyObject *owned_metaclass = NULL;
11715  if (allow_py2_metaclass) {
11716  owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
11717  if (owned_metaclass) {
11718  metaclass = owned_metaclass;
11719  } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
11720  PyErr_Clear();
11721  } else {
11722  return NULL;
11723  }
11724  }
11725  if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
11726  metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
11727  Py_XDECREF(owned_metaclass);
11728  if (unlikely(!metaclass))
11729  return NULL;
11730  owned_metaclass = metaclass;
11731  }
11732  margs = PyTuple_Pack(3, name, bases, dict);
11733  if (unlikely(!margs)) {
11734  result = NULL;
11735  } else {
11736  result = PyObject_Call(metaclass, margs, mkw);
11737  Py_DECREF(margs);
11738  }
11739  Py_XDECREF(owned_metaclass);
11740  return result;
11741 }
11742 
11743 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
11744  PyObject *empty_list = 0;
11745  PyObject *module = 0;
11746  PyObject *global_dict = 0;
11747  PyObject *empty_dict = 0;
11748  PyObject *list;
11749  #if PY_VERSION_HEX < 0x03030000
11750  PyObject *py_import;
11751  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
11752  if (!py_import)
11753  goto bad;
11754  #endif
11755  if (from_list)
11756  list = from_list;
11757  else {
11758  empty_list = PyList_New(0);
11759  if (!empty_list)
11760  goto bad;
11761  list = empty_list;
11762  }
11763  global_dict = PyModule_GetDict(__pyx_m);
11764  if (!global_dict)
11765  goto bad;
11766  empty_dict = PyDict_New();
11767  if (!empty_dict)
11768  goto bad;
11769  #if PY_VERSION_HEX >= 0x02050000
11770  {
11771  #if PY_MAJOR_VERSION >= 3
11772  if (level == -1) {
11773  if (strchr(__Pyx_MODULE_NAME, '.')) {
11774  #if PY_VERSION_HEX < 0x03030000
11775  PyObject *py_level = PyInt_FromLong(1);
11776  if (!py_level)
11777  goto bad;
11778  module = PyObject_CallFunctionObjArgs(py_import,
11779  name, global_dict, empty_dict, list, py_level, NULL);
11780  Py_DECREF(py_level);
11781  #else
11782  module = PyImport_ImportModuleLevelObject(
11783  name, global_dict, empty_dict, list, 1);
11784  #endif
11785  if (!module) {
11786  if (!PyErr_ExceptionMatches(PyExc_ImportError))
11787  goto bad;
11788  PyErr_Clear();
11789  }
11790  }
11791  level = 0; /* try absolute import on failure */
11792  }
11793  #endif
11794  if (!module) {
11795  #if PY_VERSION_HEX < 0x03030000
11796  PyObject *py_level = PyInt_FromLong(level);
11797  if (!py_level)
11798  goto bad;
11799  module = PyObject_CallFunctionObjArgs(py_import,
11800  name, global_dict, empty_dict, list, py_level, NULL);
11801  Py_DECREF(py_level);
11802  #else
11803  module = PyImport_ImportModuleLevelObject(
11804  name, global_dict, empty_dict, list, level);
11805  #endif
11806  }
11807  }
11808  #else
11809  if (level>0) {
11810  PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
11811  goto bad;
11812  }
11813  module = PyObject_CallFunctionObjArgs(py_import,
11814  name, global_dict, empty_dict, list, NULL);
11815  #endif
11816 bad:
11817  #if PY_VERSION_HEX < 0x03030000
11818  Py_XDECREF(py_import);
11819  #endif
11820  Py_XDECREF(empty_list);
11821  Py_XDECREF(empty_dict);
11822  return module;
11823 }
11824 
11825 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \
11826  { \
11827  func_type value = func(x); \
11828  if (sizeof(target_type) < sizeof(func_type)) { \
11829  if (unlikely(value != (func_type) (target_type) value)) { \
11830  func_type zero = 0; \
11831  PyErr_SetString(PyExc_OverflowError, \
11832  (is_unsigned && unlikely(value < zero)) ? \
11833  "can't convert negative value to " #target_type : \
11834  "value too large to convert to " #target_type); \
11835  return (target_type) -1; \
11836  } \
11837  } \
11838  return (target_type) value; \
11839  }
11840 
11841 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
11842  #if CYTHON_USE_PYLONG_INTERNALS
11843  #include "longintrepr.h"
11844  #endif
11845 #endif
11846 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
11847  const int neg_one = (int) -1, const_zero = 0;
11848  const int is_unsigned = neg_one > const_zero;
11849 #if PY_MAJOR_VERSION < 3
11850  if (likely(PyInt_Check(x))) {
11851  if (sizeof(int) < sizeof(long)) {
11852  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
11853  } else {
11854  long val = PyInt_AS_LONG(x);
11855  if (is_unsigned && unlikely(val < 0)) {
11856  PyErr_SetString(PyExc_OverflowError,
11857  "can't convert negative value to int");
11858  return (int) -1;
11859  }
11860  return (int) val;
11861  }
11862  } else
11863 #endif
11864  if (likely(PyLong_Check(x))) {
11865  if (is_unsigned) {
11866 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
11867  #if CYTHON_USE_PYLONG_INTERNALS
11868  if (sizeof(digit) <= sizeof(int)) {
11869  switch (Py_SIZE(x)) {
11870  case 0: return 0;
11871  case 1: return (int) ((PyLongObject*)x)->ob_digit[0];
11872  }
11873  }
11874  #endif
11875 #endif
11876  if (unlikely(Py_SIZE(x) < 0)) {
11877  PyErr_SetString(PyExc_OverflowError,
11878  "can't convert negative value to int");
11879  return (int) -1;
11880  }
11881  if (sizeof(int) <= sizeof(unsigned long)) {
11882  __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
11883  } else if (sizeof(int) <= sizeof(unsigned long long)) {
11884  __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
11885  }
11886  } else {
11887 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
11888  #if CYTHON_USE_PYLONG_INTERNALS
11889  if (sizeof(digit) <= sizeof(int)) {
11890  switch (Py_SIZE(x)) {
11891  case 0: return 0;
11892  case 1: return +(int) ((PyLongObject*)x)->ob_digit[0];
11893  case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
11894  }
11895  }
11896  #endif
11897 #endif
11898  if (sizeof(int) <= sizeof(long)) {
11899  __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
11900  } else if (sizeof(int) <= sizeof(long long)) {
11901  __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
11902  }
11903  }
11904  {
11905 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
11906  PyErr_SetString(PyExc_RuntimeError,
11907  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
11908 #else
11909  int val;
11910  PyObject *v = __Pyx_PyNumber_Int(x);
11911  #if PY_MAJOR_VERSION < 3
11912  if (likely(v) && !PyLong_Check(v)) {
11913  PyObject *tmp = v;
11914  v = PyNumber_Long(tmp);
11915  Py_DECREF(tmp);
11916  }
11917  #endif
11918  if (likely(v)) {
11919  int one = 1; int is_little = (int)*(unsigned char *)&one;
11920  unsigned char *bytes = (unsigned char *)&val;
11921  int ret = _PyLong_AsByteArray((PyLongObject *)v,
11922  bytes, sizeof(val),
11923  is_little, !is_unsigned);
11924  Py_DECREF(v);
11925  if (likely(!ret))
11926  return val;
11927  }
11928 #endif
11929  return (int) -1;
11930  }
11931  } else {
11932  int val;
11933  PyObject *tmp = __Pyx_PyNumber_Int(x);
11934  if (!tmp) return (int) -1;
11935  val = __Pyx_PyInt_As_int(tmp);
11936  Py_DECREF(tmp);
11937  return val;
11938  }
11939 }
11940 
11941 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) {
11942  const int16_t neg_one = (int16_t) -1, const_zero = 0;
11943  const int is_unsigned = neg_one > const_zero;
11944  if (is_unsigned) {
11945  if (sizeof(int16_t) < sizeof(long)) {
11946  return PyInt_FromLong((long) value);
11947  } else if (sizeof(int16_t) <= sizeof(unsigned long)) {
11948  return PyLong_FromUnsignedLong((unsigned long) value);
11949  } else if (sizeof(int16_t) <= sizeof(unsigned long long)) {
11950  return PyLong_FromUnsignedLongLong((unsigned long long) value);
11951  }
11952  } else {
11953  if (sizeof(int16_t) <= sizeof(long)) {
11954  return PyInt_FromLong((long) value);
11955  } else if (sizeof(int16_t) <= sizeof(long long)) {
11956  return PyLong_FromLongLong((long long) value);
11957  }
11958  }
11959  {
11960  int one = 1; int little = (int)*(unsigned char *)&one;
11961  unsigned char *bytes = (unsigned char *)&value;
11962  return _PyLong_FromByteArray(bytes, sizeof(int16_t),
11963  little, !is_unsigned);
11964  }
11965 }
11966 
11967 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(int8_t value) {
11968  const int8_t neg_one = (int8_t) -1, const_zero = 0;
11969  const int is_unsigned = neg_one > const_zero;
11970  if (is_unsigned) {
11971  if (sizeof(int8_t) < sizeof(long)) {
11972  return PyInt_FromLong((long) value);
11973  } else if (sizeof(int8_t) <= sizeof(unsigned long)) {
11974  return PyLong_FromUnsignedLong((unsigned long) value);
11975  } else if (sizeof(int8_t) <= sizeof(unsigned long long)) {
11976  return PyLong_FromUnsignedLongLong((unsigned long long) value);
11977  }
11978  } else {
11979  if (sizeof(int8_t) <= sizeof(long)) {
11980  return PyInt_FromLong((long) value);
11981  } else if (sizeof(int8_t) <= sizeof(long long)) {
11982  return PyLong_FromLongLong((long long) value);
11983  }
11984  }
11985  {
11986  int one = 1; int little = (int)*(unsigned char *)&one;
11987  unsigned char *bytes = (unsigned char *)&value;
11988  return _PyLong_FromByteArray(bytes, sizeof(int8_t),
11989  little, !is_unsigned);
11990  }
11991 }
11992 
11993 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
11994  const int neg_one = (int) -1, const_zero = 0;
11995  const int is_unsigned = neg_one > const_zero;
11996  if (is_unsigned) {
11997  if (sizeof(int) < sizeof(long)) {
11998  return PyInt_FromLong((long) value);
11999  } else if (sizeof(int) <= sizeof(unsigned long)) {
12000  return PyLong_FromUnsignedLong((unsigned long) value);
12001  } else if (sizeof(int) <= sizeof(unsigned long long)) {
12002  return PyLong_FromUnsignedLongLong((unsigned long long) value);
12003  }
12004  } else {
12005  if (sizeof(int) <= sizeof(long)) {
12006  return PyInt_FromLong((long) value);
12007  } else if (sizeof(int) <= sizeof(long long)) {
12008  return PyLong_FromLongLong((long long) value);
12009  }
12010  }
12011  {
12012  int one = 1; int little = (int)*(unsigned char *)&one;
12013  unsigned char *bytes = (unsigned char *)&value;
12014  return _PyLong_FromByteArray(bytes, sizeof(int),
12015  little, !is_unsigned);
12016  }
12017 }
12018 
12019 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) {
12020  const int32_t neg_one = (int32_t) -1, const_zero = 0;
12021  const int is_unsigned = neg_one > const_zero;
12022  if (is_unsigned) {
12023  if (sizeof(int32_t) < sizeof(long)) {
12024  return PyInt_FromLong((long) value);
12025  } else if (sizeof(int32_t) <= sizeof(unsigned long)) {
12026  return PyLong_FromUnsignedLong((unsigned long) value);
12027  } else if (sizeof(int32_t) <= sizeof(unsigned long long)) {
12028  return PyLong_FromUnsignedLongLong((unsigned long long) value);
12029  }
12030  } else {
12031  if (sizeof(int32_t) <= sizeof(long)) {
12032  return PyInt_FromLong((long) value);
12033  } else if (sizeof(int32_t) <= sizeof(long long)) {
12034  return PyLong_FromLongLong((long long) value);
12035  }
12036  }
12037  {
12038  int one = 1; int little = (int)*(unsigned char *)&one;
12039  unsigned char *bytes = (unsigned char *)&value;
12040  return _PyLong_FromByteArray(bytes, sizeof(int32_t),
12041  little, !is_unsigned);
12042  }
12043 }
12044 
12045 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
12046 static PyObject *__Pyx_GetStdout(void) {
12047  PyObject *f = PySys_GetObject((char *)"stdout");
12048  if (!f) {
12049  PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
12050  }
12051  return f;
12052 }
12053 static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
12054  int i;
12055  if (!f) {
12056  if (!(f = __Pyx_GetStdout()))
12057  return -1;
12058  }
12059  Py_INCREF(f);
12060  for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
12061  PyObject* v;
12062  if (PyFile_SoftSpace(f, 1)) {
12063  if (PyFile_WriteString(" ", f) < 0)
12064  goto error;
12065  }
12066  v = PyTuple_GET_ITEM(arg_tuple, i);
12067  if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
12068  goto error;
12069  if (PyString_Check(v)) {
12070  char *s = PyString_AsString(v);
12071  Py_ssize_t len = PyString_Size(v);
12072  if (len > 0) {
12073  switch (s[len-1]) {
12074  case ' ': break;
12075  case '\f': case '\r': case '\n': case '\t': case '\v':
12076  PyFile_SoftSpace(f, 0);
12077  break;
12078  default: break;
12079  }
12080  }
12081  }
12082  }
12083  if (newline) {
12084  if (PyFile_WriteString("\n", f) < 0)
12085  goto error;
12086  PyFile_SoftSpace(f, 0);
12087  }
12088  Py_DECREF(f);
12089  return 0;
12090 error:
12091  Py_DECREF(f);
12092  return -1;
12093 }
12094 #else /* Python 3 has a print function */
12095 static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
12096  PyObject* kwargs = 0;
12097  PyObject* result = 0;
12098  PyObject* end_string;
12099  if (unlikely(!__pyx_print)) {
12100  __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
12101  if (!__pyx_print)
12102  return -1;
12103  }
12104  if (stream) {
12105  kwargs = PyDict_New();
12106  if (unlikely(!kwargs))
12107  return -1;
12108  if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
12109  goto bad;
12110  if (!newline) {
12111  end_string = PyUnicode_FromStringAndSize(" ", 1);
12112  if (unlikely(!end_string))
12113  goto bad;
12114  if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
12115  Py_DECREF(end_string);
12116  goto bad;
12117  }
12118  Py_DECREF(end_string);
12119  }
12120  } else if (!newline) {
12121  if (unlikely(!__pyx_print_kwargs)) {
12122  __pyx_print_kwargs = PyDict_New();
12123  if (unlikely(!__pyx_print_kwargs))
12124  return -1;
12125  end_string = PyUnicode_FromStringAndSize(" ", 1);
12126  if (unlikely(!end_string))
12127  return -1;
12128  if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
12129  Py_DECREF(end_string);
12130  return -1;
12131  }
12132  Py_DECREF(end_string);
12133  }
12134  kwargs = __pyx_print_kwargs;
12135  }
12136  result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
12137  if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
12138  Py_DECREF(kwargs);
12139  if (!result)
12140  return -1;
12141  Py_DECREF(result);
12142  return 0;
12143 bad:
12144  if (kwargs != __pyx_print_kwargs)
12145  Py_XDECREF(kwargs);
12146  return -1;
12147 }
12148 #endif
12149 
12150 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
12151 static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
12152  if (!f) {
12153  if (!(f = __Pyx_GetStdout()))
12154  return -1;
12155  }
12156  Py_INCREF(f);
12157  if (PyFile_SoftSpace(f, 0)) {
12158  if (PyFile_WriteString(" ", f) < 0)
12159  goto error;
12160  }
12161  if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
12162  goto error;
12163  if (PyFile_WriteString("\n", f) < 0)
12164  goto error;
12165  Py_DECREF(f);
12166  return 0;
12167 error:
12168  Py_DECREF(f);
12169  return -1;
12170  /* the line below is just to avoid C compiler
12171  * warnings about unused functions */
12172  return __Pyx_Print(f, NULL, 0);
12173 }
12174 #else /* Python 3 has a print function */
12175 static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
12176  int res;
12177  PyObject* arg_tuple = PyTuple_Pack(1, o);
12178  if (unlikely(!arg_tuple))
12179  return -1;
12180  res = __Pyx_Print(stream, arg_tuple, 1);
12181  Py_DECREF(arg_tuple);
12182  return res;
12183 }
12184 #endif
12185 
12186 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
12187  const uint32_t neg_one = (uint32_t) -1, const_zero = 0;
12188  const int is_unsigned = neg_one > const_zero;
12189  if (is_unsigned) {
12190  if (sizeof(uint32_t) < sizeof(long)) {
12191  return PyInt_FromLong((long) value);
12192  } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
12193  return PyLong_FromUnsignedLong((unsigned long) value);
12194  } else if (sizeof(uint32_t) <= sizeof(unsigned long long)) {
12195  return PyLong_FromUnsignedLongLong((unsigned long long) value);
12196  }
12197  } else {
12198  if (sizeof(uint32_t) <= sizeof(long)) {
12199  return PyInt_FromLong((long) value);
12200  } else if (sizeof(uint32_t) <= sizeof(long long)) {
12201  return PyLong_FromLongLong((long long) value);
12202  }
12203  }
12204  {
12205  int one = 1; int little = (int)*(unsigned char *)&one;
12206  unsigned char *bytes = (unsigned char *)&value;
12207  return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
12208  little, !is_unsigned);
12209  }
12210 }
12211 
12212 #if CYTHON_CCOMPLEX
12213  #ifdef __cplusplus
12214  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
12215  return ::std::complex< float >(x, y);
12216  }
12217  #else
12218  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
12219  return x + y*(__pyx_t_float_complex)_Complex_I;
12220  }
12221  #endif
12222 #else
12223  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
12224  __pyx_t_float_complex z;
12225  z.real = x;
12226  z.imag = y;
12227  return z;
12228  }
12229 #endif
12230 
12231 #if CYTHON_CCOMPLEX
12232 #else
12233  static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12234  return (a.real == b.real) && (a.imag == b.imag);
12235  }
12236  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12237  __pyx_t_float_complex z;
12238  z.real = a.real + b.real;
12239  z.imag = a.imag + b.imag;
12240  return z;
12241  }
12242  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12243  __pyx_t_float_complex z;
12244  z.real = a.real - b.real;
12245  z.imag = a.imag - b.imag;
12246  return z;
12247  }
12248  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12249  __pyx_t_float_complex z;
12250  z.real = a.real * b.real - a.imag * b.imag;
12251  z.imag = a.real * b.imag + a.imag * b.real;
12252  return z;
12253  }
12254  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12255  __pyx_t_float_complex z;
12256  float denom = b.real * b.real + b.imag * b.imag;
12257  z.real = (a.real * b.real + a.imag * b.imag) / denom;
12258  z.imag = (a.imag * b.real - a.real * b.imag) / denom;
12259  return z;
12260  }
12261  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
12262  __pyx_t_float_complex z;
12263  z.real = -a.real;
12264  z.imag = -a.imag;
12265  return z;
12266  }
12267  static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
12268  return (a.real == 0) && (a.imag == 0);
12269  }
12270  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
12271  __pyx_t_float_complex z;
12272  z.real = a.real;
12273  z.imag = -a.imag;
12274  return z;
12275  }
12276  #if 1
12277  static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
12278  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
12279  return sqrtf(z.real*z.real + z.imag*z.imag);
12280  #else
12281  return hypotf(z.real, z.imag);
12282  #endif
12283  }
12284  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
12285  __pyx_t_float_complex z;
12286  float r, lnr, theta, z_r, z_theta;
12287  if (b.imag == 0 && b.real == (int)b.real) {
12288  if (b.real < 0) {
12289  float denom = a.real * a.real + a.imag * a.imag;
12290  a.real = a.real / denom;
12291  a.imag = -a.imag / denom;
12292  b.real = -b.real;
12293  }
12294  switch ((int)b.real) {
12295  case 0:
12296  z.real = 1;
12297  z.imag = 0;
12298  return z;
12299  case 1:
12300  return a;
12301  case 2:
12302  z = __Pyx_c_prodf(a, a);
12303  return __Pyx_c_prodf(a, a);
12304  case 3:
12305  z = __Pyx_c_prodf(a, a);
12306  return __Pyx_c_prodf(z, a);
12307  case 4:
12308  z = __Pyx_c_prodf(a, a);
12309  return __Pyx_c_prodf(z, z);
12310  }
12311  }
12312  if (a.imag == 0) {
12313  if (a.real == 0) {
12314  return a;
12315  }
12316  r = a.real;
12317  theta = 0;
12318  } else {
12319  r = __Pyx_c_absf(a);
12320  theta = atan2f(a.imag, a.real);
12321  }
12322  lnr = logf(r);
12323  z_r = expf(lnr * b.real - theta * b.imag);
12324  z_theta = theta * b.real + lnr * b.imag;
12325  z.real = z_r * cosf(z_theta);
12326  z.imag = z_r * sinf(z_theta);
12327  return z;
12328  }
12329  #endif
12330 #endif
12331 
12332 #if CYTHON_CCOMPLEX
12333  #ifdef __cplusplus
12334  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
12335  return ::std::complex< double >(x, y);
12336  }
12337  #else
12338  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
12339  return x + y*(__pyx_t_double_complex)_Complex_I;
12340  }
12341  #endif
12342 #else
12343  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
12344  __pyx_t_double_complex z;
12345  z.real = x;
12346  z.imag = y;
12347  return z;
12348  }
12349 #endif
12350 
12351 #if CYTHON_CCOMPLEX
12352 #else
12353  static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12354  return (a.real == b.real) && (a.imag == b.imag);
12355  }
12356  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12357  __pyx_t_double_complex z;
12358  z.real = a.real + b.real;
12359  z.imag = a.imag + b.imag;
12360  return z;
12361  }
12362  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12363  __pyx_t_double_complex z;
12364  z.real = a.real - b.real;
12365  z.imag = a.imag - b.imag;
12366  return z;
12367  }
12368  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12369  __pyx_t_double_complex z;
12370  z.real = a.real * b.real - a.imag * b.imag;
12371  z.imag = a.real * b.imag + a.imag * b.real;
12372  return z;
12373  }
12374  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12375  __pyx_t_double_complex z;
12376  double denom = b.real * b.real + b.imag * b.imag;
12377  z.real = (a.real * b.real + a.imag * b.imag) / denom;
12378  z.imag = (a.imag * b.real - a.real * b.imag) / denom;
12379  return z;
12380  }
12381  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
12382  __pyx_t_double_complex z;
12383  z.real = -a.real;
12384  z.imag = -a.imag;
12385  return z;
12386  }
12387  static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
12388  return (a.real == 0) && (a.imag == 0);
12389  }
12390  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
12391  __pyx_t_double_complex z;
12392  z.real = a.real;
12393  z.imag = -a.imag;
12394  return z;
12395  }
12396  #if 1
12397  static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
12398  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
12399  return sqrt(z.real*z.real + z.imag*z.imag);
12400  #else
12401  return hypot(z.real, z.imag);
12402  #endif
12403  }
12404  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
12405  __pyx_t_double_complex z;
12406  double r, lnr, theta, z_r, z_theta;
12407  if (b.imag == 0 && b.real == (int)b.real) {
12408  if (b.real < 0) {
12409  double denom = a.real * a.real + a.imag * a.imag;
12410  a.real = a.real / denom;
12411  a.imag = -a.imag / denom;
12412  b.real = -b.real;
12413  }
12414  switch ((int)b.real) {
12415  case 0:
12416  z.real = 1;
12417  z.imag = 0;
12418  return z;
12419  case 1:
12420  return a;
12421  case 2:
12422  z = __Pyx_c_prod(a, a);
12423  return __Pyx_c_prod(a, a);
12424  case 3:
12425  z = __Pyx_c_prod(a, a);
12426  return __Pyx_c_prod(z, a);
12427  case 4:
12428  z = __Pyx_c_prod(a, a);
12429  return __Pyx_c_prod(z, z);
12430  }
12431  }
12432  if (a.imag == 0) {
12433  if (a.real == 0) {
12434  return a;
12435  }
12436  r = a.real;
12437  theta = 0;
12438  } else {
12439  r = __Pyx_c_abs(a);
12440  theta = atan2(a.imag, a.real);
12441  }
12442  lnr = log(r);
12443  z_r = exp(lnr * b.real - theta * b.imag);
12444  z_theta = theta * b.real + lnr * b.imag;
12445  z.real = z_r * cos(z_theta);
12446  z.imag = z_r * sin(z_theta);
12447  return z;
12448  }
12449  #endif
12450 #endif
12451 
12452 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
12453  const long neg_one = (long) -1, const_zero = 0;
12454  const int is_unsigned = neg_one > const_zero;
12455  if (is_unsigned) {
12456  if (sizeof(long) < sizeof(long)) {
12457  return PyInt_FromLong((long) value);
12458  } else if (sizeof(long) <= sizeof(unsigned long)) {
12459  return PyLong_FromUnsignedLong((unsigned long) value);
12460  } else if (sizeof(long) <= sizeof(unsigned long long)) {
12461  return PyLong_FromUnsignedLongLong((unsigned long long) value);
12462  }
12463  } else {
12464  if (sizeof(long) <= sizeof(long)) {
12465  return PyInt_FromLong((long) value);
12466  } else if (sizeof(long) <= sizeof(long long)) {
12467  return PyLong_FromLongLong((long long) value);
12468  }
12469  }
12470  {
12471  int one = 1; int little = (int)*(unsigned char *)&one;
12472  unsigned char *bytes = (unsigned char *)&value;
12473  return _PyLong_FromByteArray(bytes, sizeof(long),
12474  little, !is_unsigned);
12475  }
12476 }
12477 
12478 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
12479  #if CYTHON_USE_PYLONG_INTERNALS
12480  #include "longintrepr.h"
12481  #endif
12482 #endif
12483 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
12484  const long neg_one = (long) -1, const_zero = 0;
12485  const int is_unsigned = neg_one > const_zero;
12486 #if PY_MAJOR_VERSION < 3
12487  if (likely(PyInt_Check(x))) {
12488  if (sizeof(long) < sizeof(long)) {
12489  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
12490  } else {
12491  long val = PyInt_AS_LONG(x);
12492  if (is_unsigned && unlikely(val < 0)) {
12493  PyErr_SetString(PyExc_OverflowError,
12494  "can't convert negative value to long");
12495  return (long) -1;
12496  }
12497  return (long) val;
12498  }
12499  } else
12500 #endif
12501  if (likely(PyLong_Check(x))) {
12502  if (is_unsigned) {
12503 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
12504  #if CYTHON_USE_PYLONG_INTERNALS
12505  if (sizeof(digit) <= sizeof(long)) {
12506  switch (Py_SIZE(x)) {
12507  case 0: return 0;
12508  case 1: return (long) ((PyLongObject*)x)->ob_digit[0];
12509  }
12510  }
12511  #endif
12512 #endif
12513  if (unlikely(Py_SIZE(x) < 0)) {
12514  PyErr_SetString(PyExc_OverflowError,
12515  "can't convert negative value to long");
12516  return (long) -1;
12517  }
12518  if (sizeof(long) <= sizeof(unsigned long)) {
12519  __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
12520  } else if (sizeof(long) <= sizeof(unsigned long long)) {
12521  __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
12522  }
12523  } else {
12524 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
12525  #if CYTHON_USE_PYLONG_INTERNALS
12526  if (sizeof(digit) <= sizeof(long)) {
12527  switch (Py_SIZE(x)) {
12528  case 0: return 0;
12529  case 1: return +(long) ((PyLongObject*)x)->ob_digit[0];
12530  case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
12531  }
12532  }
12533  #endif
12534 #endif
12535  if (sizeof(long) <= sizeof(long)) {
12536  __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
12537  } else if (sizeof(long) <= sizeof(long long)) {
12538  __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
12539  }
12540  }
12541  {
12542 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
12543  PyErr_SetString(PyExc_RuntimeError,
12544  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
12545 #else
12546  long val;
12547  PyObject *v = __Pyx_PyNumber_Int(x);
12548  #if PY_MAJOR_VERSION < 3
12549  if (likely(v) && !PyLong_Check(v)) {
12550  PyObject *tmp = v;
12551  v = PyNumber_Long(tmp);
12552  Py_DECREF(tmp);
12553  }
12554  #endif
12555  if (likely(v)) {
12556  int one = 1; int is_little = (int)*(unsigned char *)&one;
12557  unsigned char *bytes = (unsigned char *)&val;
12558  int ret = _PyLong_AsByteArray((PyLongObject *)v,
12559  bytes, sizeof(val),
12560  is_little, !is_unsigned);
12561  Py_DECREF(v);
12562  if (likely(!ret))
12563  return val;
12564  }
12565 #endif
12566  return (long) -1;
12567  }
12568  } else {
12569  long val;
12570  PyObject *tmp = __Pyx_PyNumber_Int(x);
12571  if (!tmp) return (long) -1;
12572  val = __Pyx_PyInt_As_long(tmp);
12573  Py_DECREF(tmp);
12574  return val;
12575  }
12576 }
12577 
12578 static int __Pyx_check_binary_version(void) {
12579  char ctversion[4], rtversion[4];
12580  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
12581  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
12582  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
12583  char message[200];
12584  PyOS_snprintf(message, sizeof(message),
12585  "compiletime version %s of module '%.100s' "
12586  "does not match runtime version %s",
12587  ctversion, __Pyx_MODULE_NAME, rtversion);
12588  #if PY_VERSION_HEX < 0x02050000
12589  return PyErr_Warn(NULL, message);
12590  #else
12591  return PyErr_WarnEx(NULL, message, 1);
12592  #endif
12593  }
12594  return 0;
12595 }
12596 
12597 #ifndef __PYX_HAVE_RT_ImportModule
12598 #define __PYX_HAVE_RT_ImportModule
12599 static PyObject *__Pyx_ImportModule(const char *name) {
12600  PyObject *py_name = 0;
12601  PyObject *py_module = 0;
12602  py_name = __Pyx_PyIdentifier_FromString(name);
12603  if (!py_name)
12604  goto bad;
12605  py_module = PyImport_Import(py_name);
12606  Py_DECREF(py_name);
12607  return py_module;
12608 bad:
12609  Py_XDECREF(py_name);
12610  return 0;
12611 }
12612 #endif
12613 
12614 #ifndef __PYX_HAVE_RT_ImportType
12615 #define __PYX_HAVE_RT_ImportType
12616 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
12617  size_t size, int strict)
12618 {
12619  PyObject *py_module = 0;
12620  PyObject *result = 0;
12621  PyObject *py_name = 0;
12622  char warning[200];
12623  Py_ssize_t basicsize;
12624 #ifdef Py_LIMITED_API
12625  PyObject *py_basicsize;
12626 #endif
12627  py_module = __Pyx_ImportModule(module_name);
12628  if (!py_module)
12629  goto bad;
12630  py_name = __Pyx_PyIdentifier_FromString(class_name);
12631  if (!py_name)
12632  goto bad;
12633  result = PyObject_GetAttr(py_module, py_name);
12634  Py_DECREF(py_name);
12635  py_name = 0;
12636  Py_DECREF(py_module);
12637  py_module = 0;
12638  if (!result)
12639  goto bad;
12640  if (!PyType_Check(result)) {
12641  PyErr_Format(PyExc_TypeError,
12642  "%.200s.%.200s is not a type object",
12643  module_name, class_name);
12644  goto bad;
12645  }
12646 #ifndef Py_LIMITED_API
12647  basicsize = ((PyTypeObject *)result)->tp_basicsize;
12648 #else
12649  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
12650  if (!py_basicsize)
12651  goto bad;
12652  basicsize = PyLong_AsSsize_t(py_basicsize);
12653  Py_DECREF(py_basicsize);
12654  py_basicsize = 0;
12655  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
12656  goto bad;
12657 #endif
12658  if (!strict && (size_t)basicsize > size) {
12659  PyOS_snprintf(warning, sizeof(warning),
12660  "%s.%s size changed, may indicate binary incompatibility",
12661  module_name, class_name);
12662  #if PY_VERSION_HEX < 0x02050000
12663  if (PyErr_Warn(NULL, warning) < 0) goto bad;
12664  #else
12665  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
12666  #endif
12667  }
12668  else if ((size_t)basicsize != size) {
12669  PyErr_Format(PyExc_ValueError,
12670  "%.200s.%.200s has the wrong size, try recompiling",
12671  module_name, class_name);
12672  goto bad;
12673  }
12674  return (PyTypeObject *)result;
12675 bad:
12676  Py_XDECREF(py_module);
12677  Py_XDECREF(result);
12678  return NULL;
12679 }
12680 #endif
12681 
12682 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
12683  int start = 0, mid = 0, end = count - 1;
12684  if (end >= 0 && code_line > entries[end].code_line) {
12685  return count;
12686  }
12687  while (start < end) {
12688  mid = (start + end) / 2;
12689  if (code_line < entries[mid].code_line) {
12690  end = mid;
12691  } else if (code_line > entries[mid].code_line) {
12692  start = mid + 1;
12693  } else {
12694  return mid;
12695  }
12696  }
12697  if (code_line <= entries[mid].code_line) {
12698  return mid;
12699  } else {
12700  return mid + 1;
12701  }
12702 }
12703 static PyCodeObject *__pyx_find_code_object(int code_line) {
12704  PyCodeObject* code_object;
12705  int pos;
12706  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
12707  return NULL;
12708  }
12709  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
12710  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
12711  return NULL;
12712  }
12713  code_object = __pyx_code_cache.entries[pos].code_object;
12714  Py_INCREF(code_object);
12715  return code_object;
12716 }
12717 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
12718  int pos, i;
12719  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
12720  if (unlikely(!code_line)) {
12721  return;
12722  }
12723  if (unlikely(!entries)) {
12724  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
12725  if (likely(entries)) {
12726  __pyx_code_cache.entries = entries;
12727  __pyx_code_cache.max_count = 64;
12728  __pyx_code_cache.count = 1;
12729  entries[0].code_line = code_line;
12730  entries[0].code_object = code_object;
12731  Py_INCREF(code_object);
12732  }
12733  return;
12734  }
12735  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
12736  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
12737  PyCodeObject* tmp = entries[pos].code_object;
12738  entries[pos].code_object = code_object;
12739  Py_DECREF(tmp);
12740  return;
12741  }
12742  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
12743  int new_max = __pyx_code_cache.max_count + 64;
12744  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
12745  __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
12746  if (unlikely(!entries)) {
12747  return;
12748  }
12749  __pyx_code_cache.entries = entries;
12750  __pyx_code_cache.max_count = new_max;
12751  }
12752  for (i=__pyx_code_cache.count; i>pos; i--) {
12753  entries[i] = entries[i-1];
12754  }
12755  entries[pos].code_line = code_line;
12756  entries[pos].code_object = code_object;
12757  __pyx_code_cache.count++;
12758  Py_INCREF(code_object);
12759 }
12760 
12761 #include "compile.h"
12762 #include "frameobject.h"
12763 #include "traceback.h"
12764 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
12765  const char *funcname, int c_line,
12766  int py_line, const char *filename) {
12767  PyCodeObject *py_code = 0;
12768  PyObject *py_srcfile = 0;
12769  PyObject *py_funcname = 0;
12770  #if PY_MAJOR_VERSION < 3
12771  py_srcfile = PyString_FromString(filename);
12772  #else
12773  py_srcfile = PyUnicode_FromString(filename);
12774  #endif
12775  if (!py_srcfile) goto bad;
12776  if (c_line) {
12777  #if PY_MAJOR_VERSION < 3
12778  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
12779  #else
12780  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
12781  #endif
12782  }
12783  else {
12784  #if PY_MAJOR_VERSION < 3
12785  py_funcname = PyString_FromString(funcname);
12786  #else
12787  py_funcname = PyUnicode_FromString(funcname);
12788  #endif
12789  }
12790  if (!py_funcname) goto bad;
12791  py_code = __Pyx_PyCode_New(
12792  0, /*int argcount,*/
12793  0, /*int kwonlyargcount,*/
12794  0, /*int nlocals,*/
12795  0, /*int stacksize,*/
12796  0, /*int flags,*/
12797  __pyx_empty_bytes, /*PyObject *code,*/
12798  __pyx_empty_tuple, /*PyObject *consts,*/
12799  __pyx_empty_tuple, /*PyObject *names,*/
12800  __pyx_empty_tuple, /*PyObject *varnames,*/
12801  __pyx_empty_tuple, /*PyObject *freevars,*/
12802  __pyx_empty_tuple, /*PyObject *cellvars,*/
12803  py_srcfile, /*PyObject *filename,*/
12804  py_funcname, /*PyObject *name,*/
12805  py_line, /*int firstlineno,*/
12806  __pyx_empty_bytes /*PyObject *lnotab*/
12807  );
12808  Py_DECREF(py_srcfile);
12809  Py_DECREF(py_funcname);
12810  return py_code;
12811 bad:
12812  Py_XDECREF(py_srcfile);
12813  Py_XDECREF(py_funcname);
12814  return NULL;
12815 }
12816 static void __Pyx_AddTraceback(const char *funcname, int c_line,
12817  int py_line, const char *filename) {
12818  PyCodeObject *py_code = 0;
12819  PyObject *py_globals = 0;
12820  PyFrameObject *py_frame = 0;
12821  py_code = __pyx_find_code_object(c_line ? c_line : py_line);
12822  if (!py_code) {
12823  py_code = __Pyx_CreateCodeObjectForTraceback(
12824  funcname, c_line, py_line, filename);
12825  if (!py_code) goto bad;
12826  __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
12827  }
12828  py_globals = PyModule_GetDict(__pyx_m);
12829  if (!py_globals) goto bad;
12830  py_frame = PyFrame_New(
12831  PyThreadState_GET(), /*PyThreadState *tstate,*/
12832  py_code, /*PyCodeObject *code,*/
12833  py_globals, /*PyObject *globals,*/
12834  0 /*PyObject *locals*/
12835  );
12836  if (!py_frame) goto bad;
12837  py_frame->f_lineno = py_line;
12838  PyTraceBack_Here(py_frame);
12839 bad:
12840  Py_XDECREF(py_code);
12841  Py_XDECREF(py_frame);
12842 }
12843 
12844 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
12845  while (t->p) {
12846  #if PY_MAJOR_VERSION < 3
12847  if (t->is_unicode) {
12848  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
12849  } else if (t->intern) {
12850  *t->p = PyString_InternFromString(t->s);
12851  } else {
12852  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
12853  }
12854  #else /* Python 3+ has unicode identifiers */
12855  if (t->is_unicode | t->is_str) {
12856  if (t->intern) {
12857  *t->p = PyUnicode_InternFromString(t->s);
12858  } else if (t->encoding) {
12859  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
12860  } else {
12861  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
12862  }
12863  } else {
12864  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
12865  }
12866  #endif
12867  if (!*t->p)
12868  return -1;
12869  ++t;
12870  }
12871  return 0;
12872 }
12873 
12874 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
12875  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
12876 }
12877 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
12878  Py_ssize_t ignore;
12879  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
12880 }
12881 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12882 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
12883  if (
12884 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12885  __Pyx_sys_getdefaultencoding_not_ascii &&
12886 #endif
12887  PyUnicode_Check(o)) {
12888 #if PY_VERSION_HEX < 0x03030000
12889  char* defenc_c;
12890  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
12891  if (!defenc) return NULL;
12892  defenc_c = PyBytes_AS_STRING(defenc);
12893 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12894  {
12895  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
12896  char* c;
12897  for (c = defenc_c; c < end; c++) {
12898  if ((unsigned char) (*c) >= 128) {
12899  PyUnicode_AsASCIIString(o);
12900  return NULL;
12901  }
12902  }
12903  }
12904 #endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
12905  *length = PyBytes_GET_SIZE(defenc);
12906  return defenc_c;
12907 #else /* PY_VERSION_HEX < 0x03030000 */
12908  if (PyUnicode_READY(o) == -1) return NULL;
12909 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12910  if (PyUnicode_IS_ASCII(o)) {
12911  *length = PyUnicode_GET_LENGTH(o);
12912  return PyUnicode_AsUTF8(o);
12913  } else {
12914  PyUnicode_AsASCIIString(o);
12915  return NULL;
12916  }
12917 #else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
12918  return PyUnicode_AsUTF8AndSize(o, length);
12919 #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
12920 #endif /* PY_VERSION_HEX < 0x03030000 */
12921  } else
12922 #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
12923 #if !CYTHON_COMPILING_IN_PYPY
12924 #if PY_VERSION_HEX >= 0x02060000
12925  if (PyByteArray_Check(o)) {
12926  *length = PyByteArray_GET_SIZE(o);
12927  return PyByteArray_AS_STRING(o);
12928  } else
12929 #endif
12930 #endif
12931  {
12932  char* result;
12933  int r = PyBytes_AsStringAndSize(o, &result, length);
12934  if (unlikely(r < 0)) {
12935  return NULL;
12936  } else {
12937  return result;
12938  }
12939  }
12940 }
12941 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
12942  int is_true = x == Py_True;
12943  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
12944  else return PyObject_IsTrue(x);
12945 }
12946 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
12947  PyNumberMethods *m;
12948  const char *name = NULL;
12949  PyObject *res = NULL;
12950 #if PY_MAJOR_VERSION < 3
12951  if (PyInt_Check(x) || PyLong_Check(x))
12952 #else
12953  if (PyLong_Check(x))
12954 #endif
12955  return Py_INCREF(x), x;
12956  m = Py_TYPE(x)->tp_as_number;
12957 #if PY_MAJOR_VERSION < 3
12958  if (m && m->nb_int) {
12959  name = "int";
12960  res = PyNumber_Int(x);
12961  }
12962  else if (m && m->nb_long) {
12963  name = "long";
12964  res = PyNumber_Long(x);
12965  }
12966 #else
12967  if (m && m->nb_int) {
12968  name = "int";
12969  res = PyNumber_Long(x);
12970  }
12971 #endif
12972  if (res) {
12973 #if PY_MAJOR_VERSION < 3
12974  if (!PyInt_Check(res) && !PyLong_Check(res)) {
12975 #else
12976  if (!PyLong_Check(res)) {
12977 #endif
12978  PyErr_Format(PyExc_TypeError,
12979  "__%.4s__ returned non-%.4s (type %.200s)",
12980  name, name, Py_TYPE(res)->tp_name);
12981  Py_DECREF(res);
12982  return NULL;
12983  }
12984  }
12985  else if (!PyErr_Occurred()) {
12986  PyErr_SetString(PyExc_TypeError,
12987  "an integer is required");
12988  }
12989  return res;
12990 }
12991 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
12992  #if CYTHON_USE_PYLONG_INTERNALS
12993  #include "longintrepr.h"
12994  #endif
12995 #endif
12996 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
12997  Py_ssize_t ival;
12998  PyObject *x;
12999 #if PY_MAJOR_VERSION < 3
13000  if (likely(PyInt_CheckExact(b)))
13001  return PyInt_AS_LONG(b);
13002 #endif
13003  if (likely(PyLong_CheckExact(b))) {
13004  #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
13005  #if CYTHON_USE_PYLONG_INTERNALS
13006  switch (Py_SIZE(b)) {
13007  case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
13008  case 0: return 0;
13009  case 1: return ((PyLongObject*)b)->ob_digit[0];
13010  }
13011  #endif
13012  #endif
13013  #if PY_VERSION_HEX < 0x02060000
13014  return PyInt_AsSsize_t(b);
13015  #else
13016  return PyLong_AsSsize_t(b);
13017  #endif
13018  }
13019  x = PyNumber_Index(b);
13020  if (!x) return -1;
13021  ival = PyInt_AsSsize_t(x);
13022  Py_DECREF(x);
13023  return ival;
13024 }
13025 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
13026 #if PY_VERSION_HEX < 0x02050000
13027  if (ival <= LONG_MAX)
13028  return PyInt_FromLong((long)ival);
13029  else {
13030  unsigned char *bytes = (unsigned char *) &ival;
13031  int one = 1; int little = (int)*(unsigned char*)&one;
13032  return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
13033  }
13034 #else
13035  return PyInt_FromSize_t(ival);
13036 #endif
13037 }
13038 
13039 
13040 #endif /* Py_PYTHON_H */
void freenect_set_video_callback(freenect_device *dev, freenect_video_cb cb)
Definition: fakenect.c:241
int freenect_sync_get_depth(void **depth, uint32_t *timestamp, int index, freenect_depth_format fmt)
void freenect_select_subdevices(freenect_context *ctx, freenect_device_flags subdevs)
Definition: fakenect.c:338
void freenect_get_mks_accel(freenect_raw_tilt_state *state, double *x, double *y, double *z)
Definition: fakenect.c:227
short int16_t
int freenect_stop_video(freenect_device *dev)
Definition: fakenect.c:383
freenect_video_format
Definition: libfreenect.h:86
int freenect_num_devices(freenect_context *ctx)
Definition: fakenect.c:308
int freenect_start_depth(freenect_device *dev)
Definition: fakenect.c:365
int freenect_set_led(freenect_device *dev, freenect_led_options option)
Definition: fakenect.c:414
signed char int8_t
int freenect_shutdown(freenect_context *ctx)
Definition: fakenect.c:402
freenect_depth_format
Definition: libfreenect.h:99
int freenect_set_video_mode(freenect_device *dev, const freenect_frame_mode mode)
Definition: fakenect.c:246
int freenect_set_tilt_degs(freenect_device *dev, double angle)
Definition: fakenect.c:410
void freenect_set_depth_callback(freenect_device *dev, freenect_depth_cb cb)
Definition: fakenect.c:236
int freenect_start_video(freenect_device *dev)
Definition: fakenect.c:371
double freenect_get_tilt_degs(freenect_raw_tilt_state *state)
Definition: fakenect.c:211
freenect_frame_mode freenect_find_video_mode(freenect_resolution res, freenect_video_format fmt)
Definition: fakenect.c:260
freenect_frame_mode freenect_get_current_depth_mode(freenect_device *dev)
Definition: fakenect.c:303
freenect_frame_mode freenect_find_depth_mode(freenect_resolution res, freenect_depth_format fmt)
Definition: fakenect.c:284
int int32_t
freenect_led_options
Definition: libfreenect.h:148
void freenect_sync_stop(void)
freenect_raw_tilt_state * freenect_get_tilt_state(freenect_device *dev)
Definition: fakenect.c:217
int freenect_update_tilt_state(freenect_device *dev)
Definition: fakenect.c:418
int freenect_close_device(freenect_device *dev)
Definition: fakenect.c:406
int freenect_set_depth_mode(freenect_device *dev, const freenect_frame_mode mode)
Definition: fakenect.c:253
freenect_frame_mode freenect_get_current_video_mode(freenect_device *dev)
Definition: fakenect.c:279
int freenect_open_device(freenect_context *ctx, freenect_device **dev, int index)
Definition: fakenect.c:314
typedef void(ONI_CALLBACK_TYPE *DeviceConnectedCallback)(const OniDeviceInfo *
static freenect_context * ctx
Data from the tilt motor and accelerometer.
Definition: libfreenect.h:167
unsigned int uint32_t
int freenect_sync_get_video(void **video, uint32_t *timestamp, int index, freenect_video_format fmt)
freenect_device_flags
Definition: libfreenect.h:58
int freenect_stop_depth(freenect_device *dev)
Definition: fakenect.c:377
int freenect_process_events(freenect_context *ctx)
Definition: fakenect.c:140
freenect_video_format video_format
Definition: libfreenect.h:134
int freenect_init(freenect_context **ctx, freenect_usb_context *usb_ctx)
Definition: fakenect.c:327


libfreenect
Author(s): Hector Martin, Josh Blake, Kyle Machulis, OpenKinect community
autogenerated on Mon Jun 10 2019 13:46:42