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 9 #ifdef PYLONG_BITS_IN_DIGIT 10 #define CYTHON_USE_PYLONG_INTERNALS 1 12 #define CYTHON_USE_PYLONG_INTERNALS 0 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+. 22 #define CYTHON_ABI "0_20_2" 25 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 27 #if !defined(WIN32) && !defined(MS_WINDOWS) 39 #define DL_IMPORT(t) t 42 #define DL_EXPORT(t) t 45 #define PY_LONG_LONG LONG_LONG 48 #define Py_HUGE_VAL HUGE_VAL 51 #define CYTHON_COMPILING_IN_PYPY 1 52 #define CYTHON_COMPILING_IN_CPYTHON 0 54 #define CYTHON_COMPILING_IN_PYPY 0 55 #define CYTHON_COMPILING_IN_CPYTHON 1 57 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 58 #define Py_OptimizeFlag 0 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), \ 72 #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_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" 78 #define __PYX_BUILD_PY_SSIZE_T "n" 79 #define CYTHON_FORMAT_SSIZE_T "z" 80 #define __Pyx_PyIndex_Check PyIndex_Check 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) 99 Py_ssize_t *suboffsets;
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 *);
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 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 127 #if PY_VERSION_HEX < 0x02060000 128 #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") 130 #if PY_MAJOR_VERSION >= 3 131 #define Py_TPFLAGS_CHECKTYPES 0 132 #define Py_TPFLAGS_HAVE_INDEX 0 134 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) 135 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 137 #if PY_VERSION_HEX < 0x02060000 138 #define Py_TPFLAGS_HAVE_VERSION_TAG 0 140 #if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) 141 #define Py_TPFLAGS_IS_ABSTRACT 0 143 #if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) 144 #define Py_TPFLAGS_HAVE_FINALIZE 0 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) 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])) 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) 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)) 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) 177 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 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 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 204 #if PY_MAJOR_VERSION >= 3 205 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 206 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 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)) 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) 216 #ifndef PySet_CheckExact 217 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 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 237 #if PY_MAJOR_VERSION >= 3 238 #define PyBoolObject PyLongObject 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 245 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 246 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t 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) 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))) 266 #if PY_MAJOR_VERSION >= 3 267 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) 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))) 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)) 278 #if PY_VERSION_HEX < 0x02050000 279 #define __Pyx_NAMESTR(n) ((char *)(n)) 280 #define __Pyx_DOCSTR(n) ((char *)(n)) 282 #define __Pyx_NAMESTR(n) (n) 283 #define __Pyx_DOCSTR(n) (n) 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 293 #define CYTHON_INLINE 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 304 #define CYTHON_RESTRICT 308 #define __PYX_NAN() ((float) NAN) 310 static CYTHON_INLINE
float __PYX_NAN() {
315 memset(&value, 0xFF,
sizeof(value));
321 void __Pyx_call_destructor(T* x) {
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) 331 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 332 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 335 #ifndef __PYX_EXTERN_C 337 #define __PYX_EXTERN_C extern "C" 339 #define __PYX_EXTERN_C extern 343 #if defined(WIN32) || defined(MS_WINDOWS) 344 #define _USE_MATH_DEFINES 347 #define __PYX_HAVE__freenect 348 #define __PYX_HAVE_API__freenect 353 #include "numpy/arrayobject.h" 354 #include "numpy/ufuncobject.h" 361 #ifdef PYREX_WITHOUT_ASSERTIONS 362 #define CYTHON_WITHOUT_ASSERTIONS 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__)) 370 # define CYTHON_UNUSED 372 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 373 # define CYTHON_UNUSED __attribute__ ((__unused__)) 375 # define CYTHON_UNUSED 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;
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 407 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 408 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 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)
420 const Py_UNICODE *u_end = u;
422 return (
size_t)(u_end - u - 1);
425 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen 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)) 439 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 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) {
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");
452 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
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;
460 char ascii_chars[128];
462 for (c = 0; c < 128; c++) {
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) {
472 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
476 Py_DECREF(ascii_chars_u);
477 Py_DECREF(ascii_chars_b);
479 Py_DECREF(default_encoding);
482 Py_XDECREF(default_encoding);
483 Py_XDECREF(ascii_chars_u);
484 Py_XDECREF(ascii_chars_b);
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) 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) {
496 PyObject* default_encoding = NULL;
497 char* default_encoding_c;
498 sys = PyImport_ImportModule(
"sys");
500 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
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);
511 Py_XDECREF(default_encoding);
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) 523 #define likely(x) (x) 524 #define unlikely(x) (x) 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;
537 #if !defined(CYTHON_CCOMPLEX) 538 #if defined(__cplusplus) 539 #define CYTHON_CCOMPLEX 1 540 #elif defined(_Complex_I) 541 #define CYTHON_CCOMPLEX 1 543 #define CYTHON_CCOMPLEX 0 553 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) 555 #define _Complex_I 1.0fj 559 static const char *__pyx_f[] = {
572 typedef npy_int8 __pyx_t_5numpy_int8_t;
581 typedef npy_int16 __pyx_t_5numpy_int16_t;
590 typedef npy_int32 __pyx_t_5numpy_int32_t;
599 typedef npy_int64 __pyx_t_5numpy_int64_t;
608 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
617 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
626 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
635 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
644 typedef npy_float32 __pyx_t_5numpy_float32_t;
653 typedef npy_float64 __pyx_t_5numpy_float64_t;
662 typedef npy_long __pyx_t_5numpy_int_t;
671 typedef npy_longlong __pyx_t_5numpy_long_t;
680 typedef npy_longlong __pyx_t_5numpy_longlong_t;
689 typedef npy_ulong __pyx_t_5numpy_uint_t;
698 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
707 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
716 typedef npy_intp __pyx_t_5numpy_intp_t;
725 typedef npy_uintp __pyx_t_5numpy_uintp_t;
734 typedef npy_double __pyx_t_5numpy_float_t;
743 typedef npy_double __pyx_t_5numpy_double_t;
752 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
755 typedef ::std::complex< float > __pyx_t_float_complex;
757 typedef float _Complex __pyx_t_float_complex;
760 typedef struct {
float real, imag; } __pyx_t_float_complex;
765 typedef ::std::complex< double > __pyx_t_double_complex;
767 typedef double _Complex __pyx_t_double_complex;
770 typedef struct {
double real, imag; } __pyx_t_double_complex;
775 struct __pyx_obj_8freenect_CtxPtr;
776 struct __pyx_obj_8freenect_DevPtr;
777 struct __pyx_obj_8freenect_StatePtr;
786 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
795 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
804 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
813 typedef npy_cdouble __pyx_t_5numpy_complex_t;
822 struct __pyx_obj_8freenect_CtxPtr {
835 struct __pyx_obj_8freenect_DevPtr {
838 struct __pyx_obj_8freenect_CtxPtr *
ctx;
849 struct __pyx_obj_8freenect_StatePtr {
854 #ifndef CYTHON_REFNANNY 855 #define CYTHON_REFNANNY 0 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);
868 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 870 #define __Pyx_RefNannySetupContext(name, 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); \ 876 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ 879 #define __Pyx_RefNannySetupContext(name, acquire_gil) \ 880 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 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) 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) 905 #define __Pyx_XDECREF_SET(r, v) do { \ 906 PyObject *tmp = (PyObject *) r; \ 907 r = v; __Pyx_XDECREF(tmp); \ 909 #define __Pyx_DECREF_SET(r, v) do { \ 910 PyObject *tmp = (PyObject *) r; \ 911 r = v; __Pyx_DECREF(tmp); \ 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) 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));
925 return PyObject_GetAttr(obj, attr_name);
928 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 931 static PyObject *__Pyx_GetBuiltinName(PyObject *
name);
933 #if CYTHON_COMPILING_IN_CPYTHON 934 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
936 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) 939 static CYTHON_INLINE
void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
940 static CYTHON_INLINE
void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
942 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
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);
947 static CYTHON_INLINE
int __Pyx_CheckKeywordStrings(PyObject *kwdict,
const char* function_name,
int kw_allowed);
949 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
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);
955 static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
956 const char *
name,
int exact);
958 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
960 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *
name);
962 #ifndef __PYX_FORCE_INIT_THREADS 963 #define __PYX_FORCE_INIT_THREADS 0 966 static void __Pyx_WriteUnraisable(
const char *
name,
int clineno,
967 int lineno,
const char *filename,
970 static CYTHON_INLINE
void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
971 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
973 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
975 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
977 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
979 static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *
name);
981 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
983 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *
name, PyObject *qualname,
984 PyObject *mkw, PyObject *modname, PyObject *doc);
985 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *
name, PyObject *bases, PyObject *dict,
986 PyObject *mkw,
int calculate_metaclass,
int allow_py2_metaclass);
988 static PyObject *__Pyx_Import(PyObject *
name, PyObject *from_list,
int level);
990 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
992 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(
int16_t value);
994 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(
int8_t value);
996 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
998 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(
int32_t value);
1000 static int __Pyx_Print(PyObject*, PyObject *,
int);
1001 #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 1002 static PyObject* __pyx_print = 0;
1003 static PyObject* __pyx_print_kwargs = 0;
1006 static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
1008 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(
uint32_t value);
1012 #define __Pyx_CREAL(z) ((z).real()) 1013 #define __Pyx_CIMAG(z) ((z).imag()) 1015 #define __Pyx_CREAL(z) (__real__(z)) 1016 #define __Pyx_CIMAG(z) (__imag__(z)) 1019 #define __Pyx_CREAL(z) ((z).real) 1020 #define __Pyx_CIMAG(z) ((z).imag) 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)) 1026 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) 1027 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) 1030 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
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)) 1040 #define __Pyx_c_is_zerof(z) ((z)==(float)0) 1041 #define __Pyx_c_conjf(z) (::std::conj(z)) 1043 #define __Pyx_c_absf(z) (::std::abs(z)) 1044 #define __Pyx_c_powf(a, b) (::std::pow(a, b)) 1047 #define __Pyx_c_is_zerof(z) ((z)==0) 1048 #define __Pyx_c_conjf(z) (conjf(z)) 1050 #define __Pyx_c_absf(z) (cabsf(z)) 1051 #define __Pyx_c_powf(a, b) (cpowf(a, b)) 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);
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);
1069 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
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)) 1079 #define __Pyx_c_is_zero(z) ((z)==(double)0) 1080 #define __Pyx_c_conj(z) (::std::conj(z)) 1082 #define __Pyx_c_abs(z) (::std::abs(z)) 1083 #define __Pyx_c_pow(a, b) (::std::pow(a, b)) 1086 #define __Pyx_c_is_zero(z) ((z)==0) 1087 #define __Pyx_c_conj(z) (conj(z)) 1089 #define __Pyx_c_abs(z) (cabs(z)) 1090 #define __Pyx_c_pow(a, b) (cpow(a, b)) 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);
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);
1108 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1110 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1112 static int __Pyx_check_binary_version(
void);
1114 #if !defined(__Pyx_PyIdentifier_FromString) 1115 #if PY_MAJOR_VERSION < 3 1116 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) 1118 #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) 1122 static PyObject *__Pyx_ImportModule(
const char *
name);
1124 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
size_t size,
int strict);
1128 PyCodeObject* code_object;
1129 } __Pyx_CodeObjectCacheEntry;
1130 struct __Pyx_CodeObjectCache {
1133 __Pyx_CodeObjectCacheEntry* entries;
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);
1140 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
1141 int py_line,
const char *filename);
1143 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1161 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
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 *);
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 *);
1180 static PyObject *__pyx_f_8freenect_init(
int __pyx_skip_dispatch);
1181 static PyObject *__pyx_f_8freenect_open_device(
struct __pyx_obj_8freenect_CtxPtr *,
int,
int __pyx_skip_dispatch);
1186 #define __Pyx_MODULE_NAME "freenect" 1187 int __pyx_module_is_main_freenect = 0;
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);
1197 static PyObject *__pyx_pf_8freenect_6CtxPtr_2__repr__(
struct __pyx_obj_8freenect_CtxPtr *__pyx_v_self);
1198 static int __pyx_pf_8freenect_6DevPtr___init__(CYTHON_UNUSED
struct __pyx_obj_8freenect_DevPtr *__pyx_v_self);
1199 static PyObject *__pyx_pf_8freenect_6DevPtr_2__repr__(
struct __pyx_obj_8freenect_DevPtr *__pyx_v_self);
1200 static int __pyx_pf_8freenect_8StatePtr___init__(CYTHON_UNUSED
struct __pyx_obj_8freenect_StatePtr *__pyx_v_self);
1201 static PyObject *__pyx_pf_8freenect_8StatePtr_2__repr__(
struct __pyx_obj_8freenect_StatePtr *__pyx_v_self);
1202 static PyObject *__pyx_pf_8freenect_8StatePtr_4_get_accelx(
struct __pyx_obj_8freenect_StatePtr *__pyx_v_self);
1203 static PyObject *__pyx_pf_8freenect_8StatePtr_6_get_accely(
struct __pyx_obj_8freenect_StatePtr *__pyx_v_self);
1204 static PyObject *__pyx_pf_8freenect_8StatePtr_8_get_accelz(
struct __pyx_obj_8freenect_StatePtr *__pyx_v_self);
1205 static PyObject *__pyx_pf_8freenect_8StatePtr_10_get_tilt_angle(
struct __pyx_obj_8freenect_StatePtr *__pyx_v_self);
1206 static PyObject *__pyx_pf_8freenect_8StatePtr_12_get_tilt_status(
struct __pyx_obj_8freenect_StatePtr *__pyx_v_self);
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);
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);
1209 static PyObject *__pyx_pf_8freenect_4get_depth_format(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev);
1210 static PyObject *__pyx_pf_8freenect_6get_video_format(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev);
1211 static PyObject *__pyx_pf_8freenect_8start_depth(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev);
1212 static PyObject *__pyx_pf_8freenect_10start_video(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev);
1213 static PyObject *__pyx_pf_8freenect_12stop_depth(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev);
1214 static PyObject *__pyx_pf_8freenect_14stop_video(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev);
1215 static PyObject *__pyx_pf_8freenect_16shutdown(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx);
1216 static PyObject *__pyx_pf_8freenect_18process_events(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx);
1217 static PyObject *__pyx_pf_8freenect_20num_devices(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx);
1218 static PyObject *__pyx_pf_8freenect_22close_device(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev);
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);
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);
1221 static PyObject *__pyx_pf_8freenect_28update_tilt_state(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev);
1222 static PyObject *__pyx_pf_8freenect_30get_tilt_state(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev);
1223 static PyObject *__pyx_pf_8freenect_32get_mks_accel(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_StatePtr *__pyx_v_state);
1224 static PyObject *__pyx_pf_8freenect_34get_accel(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev);
1225 static PyObject *__pyx_pf_8freenect_36get_tilt_degs(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_StatePtr *__pyx_v_state);
1226 static PyObject *__pyx_pf_8freenect_38error_open_device(CYTHON_UNUSED PyObject *__pyx_self);
1227 static PyObject *__pyx_pf_8freenect_40init(CYTHON_UNUSED PyObject *__pyx_self);
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);
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);
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);
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);
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);
1233 static PyObject *__pyx_pf_8freenect_52sync_get_depth(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index, PyObject *__pyx_v_format);
1234 static PyObject *__pyx_pf_8freenect_54sync_get_video(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index, PyObject *__pyx_v_format);
1235 static PyObject *__pyx_pf_8freenect_56sync_stop(CYTHON_UNUSED PyObject *__pyx_self);
1236 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1237 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info);
1238 static PyObject *__pyx_tp_new_8freenect_CtxPtr(PyTypeObject *t, PyObject *a, PyObject *k);
1239 static PyObject *__pyx_tp_new_8freenect_DevPtr(PyTypeObject *t, PyObject *a, PyObject *k);
1240 static PyObject *__pyx_tp_new_8freenect_StatePtr(PyTypeObject *t, PyObject *a, PyObject *k);
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;
1592 static CYTHON_INLINE PyObject *__pyx_f_8freenect__format_ptr(
void *__pyx_v_ptr) {
1593 PyObject *__pyx_r = NULL;
1594 __Pyx_RefNannyDeclarations
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);
1610 __pyx_t_1 = (((
sizeof(
void *)) == 4) != 0);
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);
1639 __pyx_t_1 = (((
sizeof(
void *)) == 8) != 0);
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);
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;}
1686 __Pyx_XDECREF(__pyx_t_2);
1687 __Pyx_XDECREF(__pyx_t_3);
1688 __Pyx_AddTraceback(
"freenect._format_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
1691 __Pyx_XGIVEREF(__pyx_r);
1692 __Pyx_RefNannyFinishContext();
1705 static int __pyx_pw_8freenect_6CtxPtr_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
1706 static int __pyx_pw_8freenect_6CtxPtr_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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));
1716 __Pyx_RefNannyFinishContext();
1720 static int __pyx_pf_8freenect_6CtxPtr___init__(CYTHON_UNUSED
struct __pyx_obj_8freenect_CtxPtr *__pyx_v_self) {
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);
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;}
1752 __Pyx_XDECREF(__pyx_t_1);
1753 __Pyx_AddTraceback(
"freenect.CtxPtr.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1755 __Pyx_RefNannyFinishContext();
1768 static PyObject *__pyx_pw_8freenect_6CtxPtr_3__repr__(PyObject *__pyx_v_self);
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));
1776 __Pyx_RefNannyFinishContext();
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);
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;
1817 __Pyx_XDECREF(__pyx_t_1);
1818 __Pyx_XDECREF(__pyx_t_2);
1819 __Pyx_AddTraceback(
"freenect.CtxPtr.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1822 __Pyx_XGIVEREF(__pyx_r);
1823 __Pyx_RefNannyFinishContext();
1836 static int __pyx_pw_8freenect_6DevPtr_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
1837 static int __pyx_pw_8freenect_6DevPtr_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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));
1847 __Pyx_RefNannyFinishContext();
1851 static int __pyx_pf_8freenect_6DevPtr___init__(CYTHON_UNUSED
struct __pyx_obj_8freenect_DevPtr *__pyx_v_self) {
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);
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;}
1883 __Pyx_XDECREF(__pyx_t_1);
1884 __Pyx_AddTraceback(
"freenect.DevPtr.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1886 __Pyx_RefNannyFinishContext();
1899 static PyObject *__pyx_pw_8freenect_6DevPtr_3__repr__(PyObject *__pyx_v_self);
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));
1907 __Pyx_RefNannyFinishContext();
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);
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;
1948 __Pyx_XDECREF(__pyx_t_1);
1949 __Pyx_XDECREF(__pyx_t_2);
1950 __Pyx_AddTraceback(
"freenect.DevPtr.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1953 __Pyx_XGIVEREF(__pyx_r);
1954 __Pyx_RefNannyFinishContext();
1967 static int __pyx_pw_8freenect_8StatePtr_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
1968 static int __pyx_pw_8freenect_8StatePtr_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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));
1978 __Pyx_RefNannyFinishContext();
1982 static int __pyx_pf_8freenect_8StatePtr___init__(CYTHON_UNUSED
struct __pyx_obj_8freenect_StatePtr *__pyx_v_self) {
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);
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;}
2014 __Pyx_XDECREF(__pyx_t_1);
2015 __Pyx_AddTraceback(
"freenect.StatePtr.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2017 __Pyx_RefNannyFinishContext();
2030 static PyObject *__pyx_pw_8freenect_8StatePtr_3__repr__(PyObject *__pyx_v_self);
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));
2038 __Pyx_RefNannyFinishContext();
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);
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;
2079 __Pyx_XDECREF(__pyx_t_1);
2080 __Pyx_XDECREF(__pyx_t_2);
2081 __Pyx_AddTraceback(
"freenect.StatePtr.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2084 __Pyx_XGIVEREF(__pyx_r);
2085 __Pyx_RefNannyFinishContext();
2098 static PyObject *__pyx_pw_8freenect_8StatePtr_5_get_accelx(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
2106 __Pyx_RefNannyFinishContext();
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);
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);
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;
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);
2157 __Pyx_XGIVEREF(__pyx_r);
2158 __Pyx_RefNannyFinishContext();
2171 static PyObject *__pyx_pw_8freenect_8StatePtr_7_get_accely(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
2179 __Pyx_RefNannyFinishContext();
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);
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);
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;
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);
2230 __Pyx_XGIVEREF(__pyx_r);
2231 __Pyx_RefNannyFinishContext();
2244 static PyObject *__pyx_pw_8freenect_8StatePtr_9_get_accelz(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
2252 __Pyx_RefNannyFinishContext();
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);
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);
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;
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);
2303 __Pyx_XGIVEREF(__pyx_r);
2304 __Pyx_RefNannyFinishContext();
2317 static PyObject *__pyx_pw_8freenect_8StatePtr_11_get_tilt_angle(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
2325 __Pyx_RefNannyFinishContext();
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);
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);
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;
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);
2376 __Pyx_XGIVEREF(__pyx_r);
2377 __Pyx_RefNannyFinishContext();
2390 static PyObject *__pyx_pw_8freenect_8StatePtr_13_get_tilt_status(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
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));
2398 __Pyx_RefNannyFinishContext();
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);
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);
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;
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);
2449 __Pyx_XGIVEREF(__pyx_r);
2450 __Pyx_RefNannyFinishContext();
2463 static PyObject *__pyx_pw_8freenect_1set_depth_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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;
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);
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)) {
2480 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_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);
2486 default:
goto __pyx_L5_argtuple_error;
2488 kw_args = PyDict_Size(__pyx_kwds);
2491 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev)) != 0)) kw_args--;
2492 else goto __pyx_L5_argtuple_error;
2494 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_res)) != 0)) kw_args--;
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;}
2499 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
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;}
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;}
2507 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2508 goto __pyx_L5_argtuple_error;
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);
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;}
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;}
2522 __Pyx_AddTraceback(
"freenect.set_depth_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
2523 __Pyx_RefNannyFinishContext();
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);
2534 __Pyx_RefNannyFinishContext();
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);
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;
2571 __Pyx_XDECREF(__pyx_t_1);
2572 __Pyx_AddTraceback(
"freenect.set_depth_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
2575 __Pyx_XGIVEREF(__pyx_r);
2576 __Pyx_RefNannyFinishContext();
2589 static PyObject *__pyx_pw_8freenect_3set_video_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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;
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);
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)) {
2606 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_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);
2612 default:
goto __pyx_L5_argtuple_error;
2614 kw_args = PyDict_Size(__pyx_kwds);
2617 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev)) != 0)) kw_args--;
2618 else goto __pyx_L5_argtuple_error;
2620 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_res)) != 0)) kw_args--;
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;}
2625 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
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;}
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;}
2633 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2634 goto __pyx_L5_argtuple_error;
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);
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;}
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;}
2648 __Pyx_AddTraceback(
"freenect.set_video_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
2649 __Pyx_RefNannyFinishContext();
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);
2660 __Pyx_RefNannyFinishContext();
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);
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;
2697 __Pyx_XDECREF(__pyx_t_1);
2698 __Pyx_AddTraceback(
"freenect.set_video_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
2701 __Pyx_XGIVEREF(__pyx_r);
2702 __Pyx_RefNannyFinishContext();
2715 static PyObject *__pyx_pw_8freenect_5get_depth_format(PyObject *__pyx_self, PyObject *__pyx_v_dev);
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));
2732 __Pyx_RefNannyFinishContext();
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);
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;
2769 __Pyx_XDECREF(__pyx_t_1);
2770 __Pyx_AddTraceback(
"freenect.get_depth_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
2773 __Pyx_XGIVEREF(__pyx_r);
2774 __Pyx_RefNannyFinishContext();
2787 static PyObject *__pyx_pw_8freenect_7get_video_format(PyObject *__pyx_self, PyObject *__pyx_v_dev);
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));
2804 __Pyx_RefNannyFinishContext();
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);
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;
2841 __Pyx_XDECREF(__pyx_t_1);
2842 __Pyx_AddTraceback(
"freenect.get_video_format", __pyx_clineno, __pyx_lineno, __pyx_filename);
2845 __Pyx_XGIVEREF(__pyx_r);
2846 __Pyx_RefNannyFinishContext();
2859 static PyObject *__pyx_pw_8freenect_9start_depth(PyObject *__pyx_self, PyObject *__pyx_v_dev);
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));
2876 __Pyx_RefNannyFinishContext();
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);
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;
2913 __Pyx_XDECREF(__pyx_t_1);
2914 __Pyx_AddTraceback(
"freenect.start_depth", __pyx_clineno, __pyx_lineno, __pyx_filename);
2917 __Pyx_XGIVEREF(__pyx_r);
2918 __Pyx_RefNannyFinishContext();
2931 static PyObject *__pyx_pw_8freenect_11start_video(PyObject *__pyx_self, PyObject *__pyx_v_dev);
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));
2948 __Pyx_RefNannyFinishContext();
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);
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;
2985 __Pyx_XDECREF(__pyx_t_1);
2986 __Pyx_AddTraceback(
"freenect.start_video", __pyx_clineno, __pyx_lineno, __pyx_filename);
2989 __Pyx_XGIVEREF(__pyx_r);
2990 __Pyx_RefNannyFinishContext();
3003 static PyObject *__pyx_pw_8freenect_13stop_depth(PyObject *__pyx_self, PyObject *__pyx_v_dev);
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));
3020 __Pyx_RefNannyFinishContext();
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);
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;
3057 __Pyx_XDECREF(__pyx_t_1);
3058 __Pyx_AddTraceback(
"freenect.stop_depth", __pyx_clineno, __pyx_lineno, __pyx_filename);
3061 __Pyx_XGIVEREF(__pyx_r);
3062 __Pyx_RefNannyFinishContext();
3075 static PyObject *__pyx_pw_8freenect_15stop_video(PyObject *__pyx_self, PyObject *__pyx_v_dev);
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));
3092 __Pyx_RefNannyFinishContext();
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);
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;
3129 __Pyx_XDECREF(__pyx_t_1);
3130 __Pyx_AddTraceback(
"freenect.stop_video", __pyx_clineno, __pyx_lineno, __pyx_filename);
3133 __Pyx_XGIVEREF(__pyx_r);
3134 __Pyx_RefNannyFinishContext();
3147 static PyObject *__pyx_pw_8freenect_17shutdown(PyObject *__pyx_self, PyObject *__pyx_v_ctx);
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));
3164 __Pyx_RefNannyFinishContext();
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);
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;
3201 __Pyx_XDECREF(__pyx_t_1);
3202 __Pyx_AddTraceback(
"freenect.shutdown", __pyx_clineno, __pyx_lineno, __pyx_filename);
3205 __Pyx_XGIVEREF(__pyx_r);
3206 __Pyx_RefNannyFinishContext();
3219 static PyObject *__pyx_pw_8freenect_19process_events(PyObject *__pyx_self, PyObject *__pyx_v_ctx);
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));
3236 __Pyx_RefNannyFinishContext();
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);
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;
3273 __Pyx_XDECREF(__pyx_t_1);
3274 __Pyx_AddTraceback(
"freenect.process_events", __pyx_clineno, __pyx_lineno, __pyx_filename);
3277 __Pyx_XGIVEREF(__pyx_r);
3278 __Pyx_RefNannyFinishContext();
3291 static PyObject *__pyx_pw_8freenect_21num_devices(PyObject *__pyx_self, PyObject *__pyx_v_ctx);
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));
3308 __Pyx_RefNannyFinishContext();
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);
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;
3345 __Pyx_XDECREF(__pyx_t_1);
3346 __Pyx_AddTraceback(
"freenect.num_devices", __pyx_clineno, __pyx_lineno, __pyx_filename);
3349 __Pyx_XGIVEREF(__pyx_r);
3350 __Pyx_RefNannyFinishContext();
3363 static PyObject *__pyx_pw_8freenect_23close_device(PyObject *__pyx_self, PyObject *__pyx_v_dev);
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));
3380 __Pyx_RefNannyFinishContext();
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);
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;
3417 __Pyx_XDECREF(__pyx_t_1);
3418 __Pyx_AddTraceback(
"freenect.close_device", __pyx_clineno, __pyx_lineno, __pyx_filename);
3421 __Pyx_XGIVEREF(__pyx_r);
3422 __Pyx_RefNannyFinishContext();
3435 static PyObject *__pyx_pw_8freenect_25set_tilt_degs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
3451 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3453 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3454 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3456 default:
goto __pyx_L5_argtuple_error;
3458 kw_args = PyDict_Size(__pyx_kwds);
3461 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev)) != 0)) kw_args--;
3462 else goto __pyx_L5_argtuple_error;
3464 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_angle)) != 0)) kw_args--;
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;}
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;}
3472 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3473 goto __pyx_L5_argtuple_error;
3475 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3476 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
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;}
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;}
3485 __Pyx_AddTraceback(
"freenect.set_tilt_degs", __pyx_clineno, __pyx_lineno, __pyx_filename);
3486 __Pyx_RefNannyFinishContext();
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);
3497 __Pyx_RefNannyFinishContext();
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);
3524 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3525 __Pyx_XGIVEREF(__pyx_r);
3526 __Pyx_RefNannyFinishContext();
3539 static PyObject *__pyx_pw_8freenect_27set_led(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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;
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);
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)) {
3555 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3557 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3558 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3560 default:
goto __pyx_L5_argtuple_error;
3562 kw_args = PyDict_Size(__pyx_kwds);
3565 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev)) != 0)) kw_args--;
3566 else goto __pyx_L5_argtuple_error;
3568 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_option)) != 0)) kw_args--;
3570 __Pyx_RaiseArgtupleInvalid(
"set_led", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
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;}
3576 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
3577 goto __pyx_L5_argtuple_error;
3579 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3580 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
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;}
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;}
3589 __Pyx_AddTraceback(
"freenect.set_led", __pyx_clineno, __pyx_lineno, __pyx_filename);
3590 __Pyx_RefNannyFinishContext();
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);
3601 __Pyx_RefNannyFinishContext();
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);
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;
3638 __Pyx_XDECREF(__pyx_t_1);
3639 __Pyx_AddTraceback(
"freenect.set_led", __pyx_clineno, __pyx_lineno, __pyx_filename);
3642 __Pyx_XGIVEREF(__pyx_r);
3643 __Pyx_RefNannyFinishContext();
3656 static PyObject *__pyx_pw_8freenect_29update_tilt_state(PyObject *__pyx_self, PyObject *__pyx_v_dev);
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));
3673 __Pyx_RefNannyFinishContext();
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);
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;
3710 __Pyx_XDECREF(__pyx_t_1);
3711 __Pyx_AddTraceback(
"freenect.update_tilt_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
3714 __Pyx_XGIVEREF(__pyx_r);
3715 __Pyx_RefNannyFinishContext();
3728 static PyObject *__pyx_pw_8freenect_31get_tilt_state(PyObject *__pyx_self, PyObject *__pyx_v_dev);
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));
3745 __Pyx_RefNannyFinishContext();
3749 static PyObject *__pyx_pf_8freenect_30get_tilt_state(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev) {
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);
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);
3789 __pyx_v_state_out->_ptr = __pyx_v_state;
3798 __Pyx_XDECREF(__pyx_r);
3799 __Pyx_INCREF(((PyObject *)__pyx_v_state_out));
3800 __pyx_r = ((PyObject *)__pyx_v_state_out);
3813 __Pyx_XDECREF(__pyx_t_1);
3814 __Pyx_AddTraceback(
"freenect.get_tilt_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
3817 __Pyx_XDECREF((PyObject *)__pyx_v_state_out);
3818 __Pyx_XGIVEREF(__pyx_r);
3819 __Pyx_RefNannyFinishContext();
3832 static PyObject *__pyx_pw_8freenect_33get_mks_accel(PyObject *__pyx_self, PyObject *__pyx_v_state);
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));
3849 __Pyx_RefNannyFinishContext();
3853 static PyObject *__pyx_pf_8freenect_32get_mks_accel(CYTHON_UNUSED PyObject *__pyx_self,
struct __pyx_obj_8freenect_StatePtr *__pyx_v_state) {
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);
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);
3902 __pyx_r = __pyx_t_4;
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);
3923 __Pyx_XGIVEREF(__pyx_r);
3924 __Pyx_RefNannyFinishContext();
3937 static PyObject *__pyx_pw_8freenect_35get_accel(PyObject *__pyx_self, PyObject *__pyx_v_dev);
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));
3955 __Pyx_RefNannyFinishContext();
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);
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;
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);
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;
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);
4042 __Pyx_XGIVEREF(__pyx_r);
4043 __Pyx_RefNannyFinishContext();
4056 static PyObject *__pyx_pw_8freenect_37get_tilt_degs(PyObject *__pyx_self, PyObject *__pyx_v_state);
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));
4073 __Pyx_RefNannyFinishContext();
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);
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;
4110 __Pyx_XDECREF(__pyx_t_1);
4111 __Pyx_AddTraceback(
"freenect.get_tilt_degs", __pyx_clineno, __pyx_lineno, __pyx_filename);
4114 __Pyx_XGIVEREF(__pyx_r);
4115 __Pyx_RefNannyFinishContext();
4128 static PyObject *__pyx_pw_8freenect_39error_open_device(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
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);
4137 __Pyx_RefNannyFinishContext();
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);
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;}
4167 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4170 __Pyx_AddTraceback(
"freenect.error_open_device", __pyx_clineno, __pyx_lineno, __pyx_filename);
4173 __Pyx_XGIVEREF(__pyx_r);
4174 __Pyx_RefNannyFinishContext();
4186 static PyObject *__pyx_pw_8freenect_41init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
4187 static PyObject *__pyx_f_8freenect_init(CYTHON_UNUSED
int __pyx_skip_dispatch) {
4189 struct __pyx_obj_8freenect_CtxPtr *__pyx_v_ctx_out = 0;
4190 PyObject *__pyx_r = NULL;
4191 __Pyx_RefNannyDeclarations
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);
4206 __pyx_t_1 = ((
freenect_init((&__pyx_v_ctx), NULL) < 0) != 0);
4216 __Pyx_XDECREF(__pyx_r);
4217 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
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);
4250 __pyx_v_ctx_out->_ptr = __pyx_v_ctx;
4259 __Pyx_XDECREF(__pyx_r);
4260 __Pyx_INCREF(((PyObject *)__pyx_v_ctx_out));
4261 __pyx_r = ((PyObject *)__pyx_v_ctx_out);
4274 __Pyx_XDECREF(__pyx_t_2);
4275 __Pyx_AddTraceback(
"freenect.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
4278 __Pyx_XDECREF((PyObject *)__pyx_v_ctx_out);
4279 __Pyx_XGIVEREF(__pyx_r);
4280 __Pyx_RefNannyFinishContext();
4285 static PyObject *__pyx_pw_8freenect_41init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
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);
4293 __Pyx_RefNannyFinishContext();
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;
4314 __Pyx_XDECREF(__pyx_t_1);
4315 __Pyx_AddTraceback(
"freenect.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
4318 __Pyx_XGIVEREF(__pyx_r);
4319 __Pyx_RefNannyFinishContext();
4331 static PyObject *__pyx_pw_8freenect_43open_device(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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) {
4334 struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev_out = 0;
4335 PyObject *__pyx_r = NULL;
4336 __Pyx_RefNannyDeclarations
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);
4351 __pyx_t_1 = ((
freenect_open_device(__pyx_v_ctx->_ptr, (&__pyx_v_dev), __pyx_v_index) < 0) != 0);
4361 __Pyx_XDECREF(__pyx_r);
4362 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
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);
4386 __pyx_v_dev_out->_ptr = __pyx_v_dev;
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;
4408 __Pyx_XDECREF(__pyx_r);
4409 __Pyx_INCREF(((PyObject *)__pyx_v_dev_out));
4410 __pyx_r = ((PyObject *)__pyx_v_dev_out);
4423 __Pyx_XDECREF(__pyx_t_2);
4424 __Pyx_AddTraceback(
"freenect.open_device", __pyx_clineno, __pyx_lineno, __pyx_filename);
4427 __Pyx_XDECREF((PyObject *)__pyx_v_dev_out);
4428 __Pyx_XGIVEREF(__pyx_r);
4429 __Pyx_RefNannyFinishContext();
4434 static PyObject *__pyx_pw_8freenect_43open_device(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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;
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);
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)) {
4449 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4451 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4452 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4454 default:
goto __pyx_L5_argtuple_error;
4456 kw_args = PyDict_Size(__pyx_kwds);
4459 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ctx)) != 0)) kw_args--;
4460 else goto __pyx_L5_argtuple_error;
4462 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
4464 __Pyx_RaiseArgtupleInvalid(
"open_device", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
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;}
4470 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4471 goto __pyx_L5_argtuple_error;
4473 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4474 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
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;}
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;}
4483 __Pyx_AddTraceback(
"freenect.open_device", __pyx_clineno, __pyx_lineno, __pyx_filename);
4484 __Pyx_RefNannyFinishContext();
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);
4495 __Pyx_RefNannyFinishContext();
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;
4516 __Pyx_XDECREF(__pyx_t_1);
4517 __Pyx_AddTraceback(
"freenect.open_device", __pyx_clineno, __pyx_lineno, __pyx_filename);
4520 __Pyx_XGIVEREF(__pyx_r);
4521 __Pyx_RefNannyFinishContext();
4533 static void __pyx_f_8freenect_depth_cb(
freenect_device *__pyx_v_dev,
void *__pyx_v_data,
uint32_t __pyx_v_timestamp) {
4535 struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev_out = 0;
4536 PyObject *__pyx_v_pydata = NULL;
4537 __Pyx_RefNannyDeclarations
4539 PyObject *__pyx_t_2 = NULL;
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;
4547 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
4549 __Pyx_RefNannySetupContext(
"depth_cb", 0);
4567 __pyx_t_1 = ((!(__pyx_v_mode.
is_valid != 0)) != 0);
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);
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);
4624 __pyx_v_dev_out->_ptr = __pyx_v_dev;
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;
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);
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;
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);
4682 __Pyx_XDECREF((PyObject *)__pyx_v_dev_out);
4683 __Pyx_XDECREF(__pyx_v_pydata);
4684 __Pyx_RefNannyFinishContext();
4686 PyGILState_Release(__pyx_gilstate_save);
4698 static void __pyx_f_8freenect_video_cb(
freenect_device *__pyx_v_dev,
void *__pyx_v_data,
uint32_t __pyx_v_timestamp) {
4700 struct __pyx_obj_8freenect_DevPtr *__pyx_v_dev_out = 0;
4701 PyObject *__pyx_v_pydata = NULL;
4702 __Pyx_RefNannyDeclarations
4704 PyObject *__pyx_t_2 = NULL;
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;
4712 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
4714 __Pyx_RefNannySetupContext(
"video_cb", 0);
4732 __pyx_t_1 = ((!(__pyx_v_mode.
is_valid != 0)) != 0);
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);
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);
4789 __pyx_v_dev_out->_ptr = __pyx_v_dev;
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;
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);
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;
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);
4847 __Pyx_XDECREF((PyObject *)__pyx_v_dev_out);
4848 __Pyx_XDECREF(__pyx_v_pydata);
4849 __Pyx_RefNannyFinishContext();
4851 PyGILState_Release(__pyx_gilstate_save);
4864 static PyObject *__pyx_pw_8freenect_45set_depth_callback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
4880 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4882 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4883 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4885 default:
goto __pyx_L5_argtuple_error;
4887 kw_args = PyDict_Size(__pyx_kwds);
4890 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev)) != 0)) kw_args--;
4891 else goto __pyx_L5_argtuple_error;
4893 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cb)) != 0)) kw_args--;
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;}
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;}
4901 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4902 goto __pyx_L5_argtuple_error;
4904 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4905 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4907 __pyx_v_dev = ((
struct __pyx_obj_8freenect_DevPtr *)values[0]);
4908 __pyx_v_cb = values[1];
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;}
4914 __Pyx_AddTraceback(
"freenect.set_depth_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
4915 __Pyx_RefNannyFinishContext();
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);
4926 __Pyx_RefNannyFinishContext();
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
4935 int __pyx_lineno = 0;
4936 const char *__pyx_filename = NULL;
4937 int __pyx_clineno = 0;
4938 __Pyx_RefNannySetupContext(
"set_depth_callback", 0);
4947 __pyx_t_1 = (__pyx_v_cb != Py_None);
4948 __pyx_t_2 = (__pyx_t_1 != 0);
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;}
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;}
5001 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5004 __Pyx_AddTraceback(
"freenect.set_depth_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
5007 __Pyx_XGIVEREF(__pyx_r);
5008 __Pyx_RefNannyFinishContext();
5021 static PyObject *__pyx_pw_8freenect_47set_video_callback(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
5037 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5039 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5040 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5042 default:
goto __pyx_L5_argtuple_error;
5044 kw_args = PyDict_Size(__pyx_kwds);
5047 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev)) != 0)) kw_args--;
5048 else goto __pyx_L5_argtuple_error;
5050 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cb)) != 0)) kw_args--;
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;}
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;}
5058 }
else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5059 goto __pyx_L5_argtuple_error;
5061 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5062 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5064 __pyx_v_dev = ((
struct __pyx_obj_8freenect_DevPtr *)values[0]);
5065 __pyx_v_cb = values[1];
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;}
5071 __Pyx_AddTraceback(
"freenect.set_video_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
5072 __Pyx_RefNannyFinishContext();
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);
5083 __Pyx_RefNannyFinishContext();
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
5092 int __pyx_lineno = 0;
5093 const char *__pyx_filename = NULL;
5094 int __pyx_clineno = 0;
5095 __Pyx_RefNannySetupContext(
"set_video_callback", 0);
5104 __pyx_t_1 = (__pyx_v_cb != Py_None);
5105 __pyx_t_2 = (__pyx_t_1 != 0);
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;}
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;}
5158 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5161 __Pyx_AddTraceback(
"freenect.set_video_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
5164 __Pyx_XGIVEREF(__pyx_r);
5165 __Pyx_RefNannyFinishContext();
5178 static PyObject *__pyx_pw_8freenect_49runloop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
5201 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_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);
5208 default:
goto __pyx_L5_argtuple_error;
5210 kw_args = PyDict_Size(__pyx_kwds);
5214 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth);
5215 if (value) { values[0] = value; kw_args--; }
5219 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_video);
5220 if (value) { values[1] = value; kw_args--; }
5224 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_body);
5225 if (value) { values[2] = value; kw_args--; }
5229 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dev);
5230 if (value) { values[3] = value; kw_args--; }
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;}
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);
5243 default:
goto __pyx_L5_argtuple_error;
5246 __pyx_v_depth = values[0];
5247 __pyx_v_video = values[1];
5248 __pyx_v_body = values[2];
5249 __pyx_v_dev = values[3];
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;}
5255 __Pyx_AddTraceback(
"freenect.runloop", __pyx_clineno, __pyx_lineno, __pyx_filename);
5256 __Pyx_RefNannyFinishContext();
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);
5262 __Pyx_RefNannyFinishContext();
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;
5271 PyObject *__pyx_r = NULL;
5272 __Pyx_RefNannyDeclarations
5275 PyObject *__pyx_t_3 = NULL;
5276 PyObject *__pyx_t_4 = NULL;
5279 PyObject *__pyx_t_7 = NULL;
5280 PyObject *__pyx_t_8 = NULL;
5281 PyObject *__pyx_t_9 = NULL;
5283 int __pyx_lineno = 0;
5284 const char *__pyx_filename = NULL;
5285 int __pyx_clineno = 0;
5286 __Pyx_RefNannySetupContext(
"runloop", 0);
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;}
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;}
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;}
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;}
5339 __pyx_t_1 = (__pyx_v_dev == Py_None);
5340 __pyx_t_2 = (__pyx_t_1 != 0);
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);
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);
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;
5388 __Pyx_XDECREF(__pyx_r);
5389 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
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);
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);
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;
5438 __Pyx_XDECREF(__pyx_r);
5439 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5450 __pyx_t_2 = (__pyx_v_depth != Py_None);
5451 __pyx_t_1 = (__pyx_t_2 != 0);
5473 __pyx_t_1 = (__pyx_v_video != Py_None);
5474 __pyx_t_2 = (__pyx_t_1 != 0);
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);
5514 __pyx_t_5 = __pyx_v_mdev->_ptr;
5515 __pyx_v_devp = __pyx_t_5;
5524 __pyx_t_6 = __pyx_v_mdev->ctx->_ptr;
5525 __pyx_v_ctxp = __pyx_t_6;
5534 __pyx_t_2 = (__pyx_v_depth != Py_None);
5535 __pyx_t_1 = (__pyx_t_2 != 0);
5566 __pyx_t_1 = (__pyx_v_video != Py_None);
5567 __pyx_t_2 = (__pyx_t_1 != 0);
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);
5623 PyThreadState *_save;
5645 goto __pyx_L23_break;
5667 goto __pyx_L21_break;
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;}
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;
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;
5713 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5714 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
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;
5728 PyErr_Restore(0,0,0);
5729 goto __pyx_L13_exception_handled;
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);
5771 __pyx_t_2 = (__pyx_v_dev == Py_None);
5772 __pyx_t_1 = (__pyx_t_2 != 0);
5805 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5808 __Pyx_XDECREF(__pyx_t_3);
5809 __Pyx_XDECREF(__pyx_t_4);
5810 __Pyx_AddTraceback(
"freenect.runloop", __pyx_clineno, __pyx_lineno, __pyx_filename);
5813 __Pyx_XDECREF((PyObject *)__pyx_v_mdev);
5814 __Pyx_XDECREF((PyObject *)__pyx_v_ctx);
5815 __Pyx_XGIVEREF(__pyx_r);
5816 __Pyx_RefNannyFinishContext();
5829 static PyObject *__pyx_pw_8freenect_51base_runloop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
5847 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5849 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5850 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5852 default:
goto __pyx_L5_argtuple_error;
5854 kw_args = PyDict_Size(__pyx_kwds);
5857 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ctx)) != 0)) kw_args--;
5858 else goto __pyx_L5_argtuple_error;
5861 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_body);
5862 if (value) { values[1] = value; kw_args--; }
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;}
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);
5873 default:
goto __pyx_L5_argtuple_error;
5876 __pyx_v_ctx = ((
struct __pyx_obj_8freenect_CtxPtr *)values[0]);
5877 __pyx_v_body = values[1];
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;}
5883 __Pyx_AddTraceback(
"freenect.base_runloop", __pyx_clineno, __pyx_lineno, __pyx_filename);
5884 __Pyx_RefNannyFinishContext();
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);
5895 __Pyx_RefNannyFinishContext();
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) {
5901 PyObject *__pyx_r = NULL;
5902 __Pyx_RefNannyDeclarations
5904 PyObject *__pyx_t_2 = NULL;
5905 PyObject *__pyx_t_3 = NULL;
5906 PyObject *__pyx_t_4 = NULL;
5908 PyObject *__pyx_t_6 = NULL;
5909 PyObject *__pyx_t_7 = NULL;
5911 int __pyx_lineno = 0;
5912 const char *__pyx_filename = NULL;
5913 int __pyx_clineno = 0;
5914 __Pyx_RefNannySetupContext(
"base_runloop", 0);
5923 __pyx_t_1 = __pyx_v_ctx->_ptr;
5924 __pyx_v_ctxp = __pyx_t_1;
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);
5958 PyThreadState *_save;
5980 goto __pyx_L14_break;
6002 goto __pyx_L12_break;
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;}
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;
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;
6045 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6046 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
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;
6060 PyErr_Restore(0,0,0);
6061 goto __pyx_L4_exception_handled;
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);
6087 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6090 __Pyx_XDECREF(__pyx_t_6);
6091 __Pyx_XDECREF(__pyx_t_7);
6092 __Pyx_AddTraceback(
"freenect.base_runloop", __pyx_clineno, __pyx_lineno, __pyx_filename);
6095 __Pyx_XGIVEREF(__pyx_r);
6096 __Pyx_RefNannyFinishContext();
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
6113 PyObject *__pyx_t_2 = NULL;
6114 PyObject *__pyx_t_3 = NULL;
6115 PyObject *__pyx_t_4 = NULL;
6121 int __pyx_lineno = 0;
6122 const char *__pyx_filename = NULL;
6123 int __pyx_clineno = 0;
6124 __Pyx_RefNannySetupContext(
"_depth_cb_np", 0);
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;
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;
6155 __pyx_t_7 = __pyx_t_5;
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;
6169 __pyx_t_6 = __pyx_t_7;
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;
6183 __pyx_t_5 = __pyx_t_6;
6185 __pyx_t_6 = (__pyx_t_5 != 0);
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;
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;
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;
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);
6247 __Pyx_XGIVEREF(__pyx_r);
6248 __Pyx_RefNannyFinishContext();
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
6265 PyObject *__pyx_t_2 = NULL;
6266 PyObject *__pyx_t_3 = NULL;
6267 PyObject *__pyx_t_4 = NULL;
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);
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;
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;
6308 __pyx_t_7 = __pyx_t_5;
6310 __pyx_t_5 = (__pyx_t_7 != 0);
6320 __pyx_t_8 = __pyx_v_mode->
height;
6321 __pyx_t_9 = __pyx_v_mode->
width;
6323 (__pyx_v_dims[0]) = __pyx_t_8;
6324 (__pyx_v_dims[1]) = __pyx_t_9;
6325 (__pyx_v_dims[2]) = __pyx_t_10;
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;
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;
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;
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;
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;
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;
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;
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;
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);
6464 __Pyx_XGIVEREF(__pyx_r);
6465 __Pyx_RefNannyFinishContext();
6478 static PyObject *__pyx_pw_8freenect_53sync_get_depth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
6497 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6499 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6500 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6502 default:
goto __pyx_L5_argtuple_error;
6504 kw_args = PyDict_Size(__pyx_kwds);
6508 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index);
6509 if (value) { values[0] = value; kw_args--; }
6513 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format);
6514 if (value) { values[1] = value; kw_args--; }
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;}
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);
6525 default:
goto __pyx_L5_argtuple_error;
6528 __pyx_v_index = values[0];
6529 __pyx_v_format = values[1];
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;}
6535 __Pyx_AddTraceback(
"freenect.sync_get_depth", __pyx_clineno, __pyx_lineno, __pyx_filename);
6536 __Pyx_RefNannyFinishContext();
6538 __pyx_L4_argument_unpacking_done:;
6539 __pyx_r = __pyx_pf_8freenect_52sync_get_depth(__pyx_self, __pyx_v_index, __pyx_v_format);
6542 __Pyx_RefNannyFinishContext();
6546 static PyObject *__pyx_pf_8freenect_52sync_get_depth(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index, PyObject *__pyx_v_format) {
6549 npy_intp __pyx_v_dims[2];
6553 PyObject *__pyx_r = NULL;
6554 __Pyx_RefNannyDeclarations
6558 PyObject *__pyx_t_4 = NULL;
6559 PyObject *__pyx_t_5 = NULL;
6560 PyObject *__pyx_t_6 = NULL;
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);
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;
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;
6599 PyThreadState *_save;
6611 __pyx_v_out =
freenect_sync_get_depth((&__pyx_v_data), (&__pyx_v_timestamp), __pyx_v__index, __pyx_v__format);
6639 __pyx_t_3 = (__pyx_v_out != 0);
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;
6663 __Pyx_XDECREF(__pyx_r);
6664 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
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;
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;
6692 __pyx_t_8 = __pyx_t_3;
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;
6703 __pyx_t_7 = __pyx_t_8;
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;
6714 __pyx_t_3 = __pyx_t_7;
6716 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6717 __pyx_t_7 = (__pyx_t_3 != 0);
6729 (__pyx_v_dims[0]) = __pyx_t_9;
6730 (__pyx_v_dims[1]) = __pyx_t_10;
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);
6752 __pyx_r = __pyx_t_6;
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);
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;}
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);
6796 __Pyx_XGIVEREF(__pyx_r);
6797 __Pyx_RefNannyFinishContext();
6810 static PyObject *__pyx_pw_8freenect_55sync_get_video(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
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);
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)) {
6829 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6831 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6832 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6834 default:
goto __pyx_L5_argtuple_error;
6836 kw_args = PyDict_Size(__pyx_kwds);
6840 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index);
6841 if (value) { values[0] = value; kw_args--; }
6845 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_format);
6846 if (value) { values[1] = value; kw_args--; }
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;}
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);
6857 default:
goto __pyx_L5_argtuple_error;
6860 __pyx_v_index = values[0];
6861 __pyx_v_format = values[1];
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;}
6867 __Pyx_AddTraceback(
"freenect.sync_get_video", __pyx_clineno, __pyx_lineno, __pyx_filename);
6868 __Pyx_RefNannyFinishContext();
6870 __pyx_L4_argument_unpacking_done:;
6871 __pyx_r = __pyx_pf_8freenect_54sync_get_video(__pyx_self, __pyx_v_index, __pyx_v_format);
6874 __Pyx_RefNannyFinishContext();
6878 static PyObject *__pyx_pf_8freenect_54sync_get_video(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index, PyObject *__pyx_v_format) {
6881 npy_intp __pyx_v_dims[3];
6885 PyObject *__pyx_r = NULL;
6886 __Pyx_RefNannyDeclarations
6890 PyObject *__pyx_t_4 = NULL;
6891 PyObject *__pyx_t_5 = NULL;
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);
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;
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;
6930 PyThreadState *_save;
6942 __pyx_v_out =
freenect_sync_get_video((&__pyx_v_data), (&__pyx_v_timestamp), __pyx_v__index, __pyx_v__format);
6970 __pyx_t_3 = (__pyx_v_out != 0);
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;
6994 __Pyx_XDECREF(__pyx_r);
6995 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
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;
7024 (__pyx_v_dims[0]) = __pyx_t_6;
7025 (__pyx_v_dims[1]) = __pyx_t_7;
7026 (__pyx_v_dims[2]) = __pyx_t_8;
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);
7048 __pyx_r = __pyx_t_9;
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;
7077 (__pyx_v_dims[0]) = __pyx_t_8;
7078 (__pyx_v_dims[1]) = __pyx_t_7;
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);
7100 __pyx_r = __pyx_t_4;
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;
7129 (__pyx_v_dims[0]) = __pyx_t_7;
7130 (__pyx_v_dims[1]) = __pyx_t_8;
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);
7152 __pyx_r = __pyx_t_5;
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);
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;}
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);
7196 __Pyx_XGIVEREF(__pyx_r);
7197 __Pyx_RefNannyFinishContext();
7210 static PyObject *__pyx_pw_8freenect_57sync_stop(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused);
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);
7220 __Pyx_RefNannyFinishContext();
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);
7245 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7246 __Pyx_XGIVEREF(__pyx_r);
7247 __Pyx_RefNannyFinishContext();
7260 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
7261 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
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));
7268 __Pyx_RefNannyFinishContext();
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;
7276 int __pyx_v_endian_detector;
7277 int __pyx_v_little_endian;
7280 PyArray_Descr *__pyx_v_descr = 0;
7282 int __pyx_v_hasfields;
7284 __Pyx_RefNannyDeclarations
7288 PyObject *__pyx_t_4 = NULL;
7292 PyObject *__pyx_t_8 = NULL;
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);
7310 __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
7323 __pyx_v_endian_detector = 1;
7332 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
7341 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
7350 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
7360 __pyx_v_copy_shape = 1;
7372 __pyx_v_copy_shape = 0;
7383 __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
7393 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
7394 __pyx_t_3 = __pyx_t_2;
7396 __pyx_t_3 = __pyx_t_1;
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;}
7421 __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
7431 __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
7432 __pyx_t_2 = __pyx_t_1;
7434 __pyx_t_2 = __pyx_t_3;
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;}
7459 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
7468 __pyx_v_info->ndim = __pyx_v_ndim;
7477 __pyx_t_2 = (__pyx_v_copy_shape != 0);
7487 __pyx_v_info->strides = ((Py_ssize_t *)malloc((((
sizeof(Py_ssize_t)) * ((
size_t)__pyx_v_ndim)) * 2)));
7496 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
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;
7516 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
7525 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
7538 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
7547 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
7558 __pyx_v_info->suboffsets = NULL;
7567 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
7576 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
7594 __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
7595 __Pyx_INCREF(__pyx_t_4);
7596 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
7606 __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
7615 __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
7617 __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0);
7618 __pyx_t_1 = __pyx_t_3;
7620 __pyx_t_1 = __pyx_t_2;
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;
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);
7662 __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
7672 __pyx_t_5 = __pyx_v_descr->type_num;
7673 __pyx_v_t = __pyx_t_5;
7682 __pyx_t_1 = ((__pyx_v_descr->byteorder ==
'>') != 0);
7684 __pyx_t_2 = (__pyx_v_little_endian != 0);
7686 __pyx_t_2 = __pyx_t_1;
7697 __pyx_t_1 = ((__pyx_v_descr->byteorder ==
'<') != 0);
7699 __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0);
7700 __pyx_t_7 = __pyx_t_3;
7702 __pyx_t_7 = __pyx_t_1;
7704 __pyx_t_1 = __pyx_t_7;
7706 __pyx_t_1 = __pyx_t_2;
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;}
7731 switch (__pyx_v_t) {
7741 __pyx_v_f = __pyx_k_b;
7752 __pyx_v_f = __pyx_k_B;
7763 __pyx_v_f = __pyx_k_h;
7774 __pyx_v_f = __pyx_k_H;
7785 __pyx_v_f = __pyx_k_i;
7796 __pyx_v_f = __pyx_k_I;
7807 __pyx_v_f = __pyx_k_l;
7818 __pyx_v_f = __pyx_k_L;
7829 __pyx_v_f = __pyx_k_q;
7840 __pyx_v_f = __pyx_k_Q;
7851 __pyx_v_f = __pyx_k_f;
7862 __pyx_v_f = __pyx_k_d;
7872 case NPY_LONGDOUBLE:
7873 __pyx_v_f = __pyx_k_g;
7884 __pyx_v_f = __pyx_k_Zf;
7895 __pyx_v_f = __pyx_k_Zd;
7905 case NPY_CLONGDOUBLE:
7906 __pyx_v_f = __pyx_k_Zg;
7917 __pyx_v_f = __pyx_k_O;
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);
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;}
7954 __pyx_v_info->format = __pyx_v_f;
7975 __pyx_v_info->format = ((
char *)malloc(255));
7984 (__pyx_v_info->format[0]) =
'^';
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;
8012 (__pyx_v_f[0]) =
'\x00';
8027 __Pyx_XDECREF(__pyx_t_4);
8028 __Pyx_XDECREF(__pyx_t_8);
8029 __Pyx_AddTraceback(
"numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
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;
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;
8042 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
8043 __Pyx_RefNannyFinishContext();
8056 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info);
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));
8063 __Pyx_RefNannyFinishContext();
8066 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
8067 __Pyx_RefNannyDeclarations
8069 __Pyx_RefNannySetupContext(
"__releasebuffer__", 0);
8078 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
8088 free(__pyx_v_info->format);
8100 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
8110 free(__pyx_v_info->strides);
8124 __Pyx_RefNannyFinishContext();
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);
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;
8168 __Pyx_XDECREF(__pyx_t_1);
8169 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
8172 __Pyx_XGIVEREF(__pyx_r);
8173 __Pyx_RefNannyFinishContext();
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);
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;
8218 __Pyx_XDECREF(__pyx_t_1);
8219 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
8222 __Pyx_XGIVEREF(__pyx_r);
8223 __Pyx_RefNannyFinishContext();
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);
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;
8268 __Pyx_XDECREF(__pyx_t_1);
8269 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
8272 __Pyx_XGIVEREF(__pyx_r);
8273 __Pyx_RefNannyFinishContext();
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);
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;
8318 __Pyx_XDECREF(__pyx_t_1);
8319 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
8322 __Pyx_XGIVEREF(__pyx_r);
8323 __Pyx_RefNannyFinishContext();
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);
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;
8368 __Pyx_XDECREF(__pyx_t_1);
8369 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
8372 __Pyx_XGIVEREF(__pyx_r);
8373 __Pyx_RefNannyFinishContext();
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;
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;
8406 int __pyx_lineno = 0;
8407 const char *__pyx_filename = NULL;
8408 int __pyx_clineno = 0;
8409 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
8418 __pyx_v_endian_detector = 1;
8427 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
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;}
8440 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
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;}
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;}
8448 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
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));
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);
8476 Py_ssize_t size = PySequence_Size(sequence);
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;}
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);
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);
8495 __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
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));
8500 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
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);
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;}
8541 __pyx_t_6 = ((__pyx_v_child->byteorder ==
'>') != 0);
8543 __pyx_t_7 = (__pyx_v_little_endian != 0);
8545 __pyx_t_7 = __pyx_t_6;
8556 __pyx_t_6 = ((__pyx_v_child->byteorder ==
'<') != 0);
8558 __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0);
8559 __pyx_t_9 = __pyx_t_8;
8561 __pyx_t_9 = __pyx_t_6;
8563 __pyx_t_6 = __pyx_t_9;
8565 __pyx_t_6 = __pyx_t_7;
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;}
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;
8606 (__pyx_v_f[0]) = 120;
8615 __pyx_v_f = (__pyx_v_f + 1);
8625 (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1);
8636 (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize);
8645 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
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);
8667 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
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;}
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;
8698 (__pyx_v_f[0]) = 98;
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;
8716 (__pyx_v_f[0]) = 66;
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;
8734 (__pyx_v_f[0]) = 104;
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;
8752 (__pyx_v_f[0]) = 72;
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;
8770 (__pyx_v_f[0]) = 105;
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;
8788 (__pyx_v_f[0]) = 73;
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;
8806 (__pyx_v_f[0]) = 108;
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;
8824 (__pyx_v_f[0]) = 76;
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;
8842 (__pyx_v_f[0]) = 113;
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;
8860 (__pyx_v_f[0]) = 81;
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;
8878 (__pyx_v_f[0]) = 102;
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;
8896 (__pyx_v_f[0]) = 100;
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;
8914 (__pyx_v_f[0]) = 103;
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;
8932 (__pyx_v_f[0]) = 90;
8933 (__pyx_v_f[1]) = 102;
8934 __pyx_v_f = (__pyx_v_f + 1);
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;
8952 (__pyx_v_f[0]) = 90;
8953 (__pyx_v_f[1]) = 100;
8954 __pyx_v_f = (__pyx_v_f + 1);
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;
8972 (__pyx_v_f[0]) = 90;
8973 (__pyx_v_f[1]) = 103;
8974 __pyx_v_f = (__pyx_v_f + 1);
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;
8992 (__pyx_v_f[0]) = 79;
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);
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;}
9027 __pyx_v_f = (__pyx_v_f + 1);
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;
9044 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9053 __pyx_r = __pyx_v_f;
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);
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();
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
9094 __Pyx_RefNannySetupContext(
"set_array_base", 0);
9103 __pyx_t_1 = (__pyx_v_base == Py_None);
9104 __pyx_t_2 = (__pyx_t_1 != 0);
9114 __pyx_v_baseptr = NULL;
9126 Py_INCREF(__pyx_v_base);
9135 __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
9146 Py_XDECREF(__pyx_v_arr->base);
9155 __pyx_v_arr->base = __pyx_v_baseptr;
9166 __Pyx_RefNannyFinishContext();
9177 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
9178 PyObject *__pyx_r = NULL;
9179 __Pyx_RefNannyDeclarations
9181 __Pyx_RefNannySetupContext(
"get_array_base", 0);
9190 __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
9200 __Pyx_XDECREF(__pyx_r);
9201 __Pyx_INCREF(Py_None);
9212 __Pyx_XDECREF(__pyx_r);
9213 __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
9214 __pyx_r = ((PyObject *)__pyx_v_arr->base);
9228 __Pyx_XGIVEREF(__pyx_r);
9229 __Pyx_RefNannyFinishContext();
9233 static PyObject *__pyx_tp_new_8freenect_CtxPtr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
9235 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
9236 o = (*t->tp_alloc)(t, 0);
9238 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
9240 if (unlikely(!o))
return 0;
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;
9250 (*Py_TYPE(o)->tp_free)(o);
9253 static PyMethodDef __pyx_methods_8freenect_CtxPtr[] = {
9257 static PyTypeObject __pyx_type_8freenect_CtxPtr = {
9258 PyVarObject_HEAD_INIT(0, 0)
9259 __Pyx_NAMESTR(
"freenect.CtxPtr"),
9260 sizeof(
struct __pyx_obj_8freenect_CtxPtr),
9262 __pyx_tp_dealloc_8freenect_CtxPtr,
9266 #if PY_MAJOR_VERSION < 3
9271 __pyx_pw_8freenect_6CtxPtr_3__repr__,
9281 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
9289 __pyx_methods_8freenect_CtxPtr,
9297 __pyx_pw_8freenect_6CtxPtr_1__init__,
9299 __pyx_tp_new_8freenect_CtxPtr,
9308 #if PY_VERSION_HEX >= 0x02060000
9311 #if PY_VERSION_HEX >= 0x030400a1 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;
9319 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
9320 o = (*t->tp_alloc)(t, 0);
9322 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
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);
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;
9337 PyObject_GC_UnTrack(o);
9339 (*Py_TYPE(o)->tp_free)(o);
9342 static int __pyx_tp_traverse_8freenect_DevPtr(PyObject *o, visitproc v,
void *a) {
9344 struct __pyx_obj_8freenect_DevPtr *p = (
struct __pyx_obj_8freenect_DevPtr *)o;
9346 e = (*v)(((PyObject*)p->ctx), a);
if (e)
return e;
9351 static int __pyx_tp_clear_8freenect_DevPtr(PyObject *o) {
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);
9360 static PyMethodDef __pyx_methods_8freenect_DevPtr[] = {
9364 static PyTypeObject __pyx_type_8freenect_DevPtr = {
9365 PyVarObject_HEAD_INIT(0, 0)
9366 __Pyx_NAMESTR(
"freenect.DevPtr"),
9367 sizeof(
struct __pyx_obj_8freenect_DevPtr),
9369 __pyx_tp_dealloc_8freenect_DevPtr,
9373 #if PY_MAJOR_VERSION < 3
9378 __pyx_pw_8freenect_6DevPtr_3__repr__,
9388 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
9390 __pyx_tp_traverse_8freenect_DevPtr,
9391 __pyx_tp_clear_8freenect_DevPtr,
9396 __pyx_methods_8freenect_DevPtr,
9404 __pyx_pw_8freenect_6DevPtr_1__init__,
9406 __pyx_tp_new_8freenect_DevPtr,
9415 #if PY_VERSION_HEX >= 0x02060000
9418 #if PY_VERSION_HEX >= 0x030400a1 9423 static PyObject *__pyx_tp_new_8freenect_StatePtr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
9425 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
9426 o = (*t->tp_alloc)(t, 0);
9428 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
9430 if (unlikely(!o))
return 0;
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;
9440 (*Py_TYPE(o)->tp_free)(o);
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)},
9452 static PyTypeObject __pyx_type_8freenect_StatePtr = {
9453 PyVarObject_HEAD_INIT(0, 0)
9454 __Pyx_NAMESTR(
"freenect.StatePtr"),
9455 sizeof(
struct __pyx_obj_8freenect_StatePtr),
9457 __pyx_tp_dealloc_8freenect_StatePtr,
9461 #if PY_MAJOR_VERSION < 3
9466 __pyx_pw_8freenect_8StatePtr_3__repr__,
9476 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
9484 __pyx_methods_8freenect_StatePtr,
9492 __pyx_pw_8freenect_8StatePtr_1__init__,
9494 __pyx_tp_new_8freenect_StatePtr,
9503 #if PY_VERSION_HEX >= 0x02060000
9506 #if PY_VERSION_HEX >= 0x030400a1 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)},
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 },
9522 PyModuleDef_HEAD_INIT,
9524 __Pyx_NAMESTR(
"freenect"),
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}
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;}
9680 static int __Pyx_InitCachedConstants(
void) {
9681 __Pyx_RefNannyDeclarations
9682 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
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_);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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;}
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();
10114 __Pyx_RefNannyFinishContext();
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;}
10126 #if PY_MAJOR_VERSION < 3 10127 PyMODINIT_FUNC initfreenect(
void);
10128 PyMODINIT_FUNC initfreenect(
void)
10130 PyMODINIT_FUNC PyInit_freenect(
void);
10131 PyMODINIT_FUNC PyInit_freenect(
void)
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) {
10146 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
10147 if (!__Pyx_RefNanny)
10148 Py_FatalError(
"failed to import 'refnanny' module");
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;}
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;}
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;}
10166 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 10168 PyEval_InitThreads();
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);
10175 __pyx_m = PyModule_Create(&__pyx_moduledef);
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);
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;};
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;}
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;};
10193 #if PY_MAJOR_VERSION >= 3 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;}
10202 if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10204 if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
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;
10222 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME,
"type",
10223 #
if CYTHON_COMPILING_IN_PYPY
10224 sizeof(PyTypeObject),
10226 sizeof(PyHeapTypeObject),
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;}
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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);
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;
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);
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;
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;
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;
11057 __Pyx_XDECREF(__pyx_t_1);
11058 __Pyx_XDECREF(__pyx_t_2);
11059 __Pyx_XDECREF(__pyx_t_3);
11060 __Pyx_XDECREF(__pyx_t_4);
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");
11068 __Pyx_RefNannyFinishContext();
11069 #if PY_MAJOR_VERSION < 3 11077 #if CYTHON_REFNANNY 11078 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
11079 PyObject *m = NULL, *p = NULL;
11081 m = PyImport_ImportModule((
char *)modname);
11083 p = PyObject_GetAttrString(m, (
char *)
"RefNannyAPI");
11085 r = PyLong_AsVoidPtr(p);
11089 return (__Pyx_RefNannyAPIStruct *)r;
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);
11100 "name '%.200s' is not defined", PyString_AS_STRING(name));
11106 #if CYTHON_COMPILING_IN_CPYTHON 11107 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
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")))
11116 result = (*call)(func, arg, kw);
11117 #if PY_VERSION_HEX >= 0x02060000 11118 Py_LeaveRecursiveCall();
11120 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
11123 "NULL result without error in PyObject_Call");
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);
11143 PyErr_Restore(type, value, tb);
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;
11156 PyErr_Fetch(type, value, tb);
11160 #if PY_MAJOR_VERSION < 3 11161 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
11162 CYTHON_UNUSED PyObject *cause) {
11164 if (!value || value == Py_None)
11168 if (!tb || tb == Py_None)
11172 if (!PyTraceBack_Check(tb)) {
11173 PyErr_SetString(PyExc_TypeError,
11174 "raise: arg 3 must be a traceback or None");
11178 #if PY_VERSION_HEX < 0x02050000 11179 if (PyClass_Check(type)) {
11181 if (PyType_Check(type)) {
11183 #if CYTHON_COMPILING_IN_PYPY 11185 Py_INCREF(Py_None);
11189 PyErr_NormalizeException(&type, &value, &tb);
11192 PyErr_SetString(PyExc_TypeError,
11193 "instance exception may not have a separate value");
11197 #if PY_VERSION_HEX < 0x02050000 11198 if (PyInstance_Check(type)) {
11199 type = (PyObject*) ((PyInstanceObject*)type)->in_class;
11203 PyErr_SetString(PyExc_TypeError,
11204 "raise: exception must be an old-style class or instance");
11208 type = (PyObject*) Py_TYPE(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");
11217 __Pyx_ErrRestore(type, value, tb);
11226 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
11227 PyObject* owned_instance = NULL;
11228 if (tb == Py_None) {
11230 }
else if (tb && !PyTraceBack_Check(tb)) {
11231 PyErr_SetString(PyExc_TypeError,
11232 "raise: arg 3 must be a traceback or None");
11235 if (value == Py_None)
11237 if (PyExceptionInstance_Check(type)) {
11239 PyErr_SetString(PyExc_TypeError,
11240 "instance exception may not have a separate value");
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;
11253 instance_class = NULL;
11257 if (!instance_class) {
11260 args = PyTuple_New(0);
11261 else if (PyTuple_Check(value)) {
11265 args = PyTuple_Pack(1, value);
11268 owned_instance = PyObject_Call(type, args, NULL);
11270 if (!owned_instance)
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));
11282 PyErr_SetString(PyExc_TypeError,
11283 "raise: exception class must be a subclass of BaseException");
11286 #if PY_VERSION_HEX >= 0x03030000 11289 if (cause && cause != Py_None) {
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)
11298 }
else if (PyExceptionInstance_Check(cause)) {
11299 fixed_cause = cause;
11300 Py_INCREF(fixed_cause);
11302 PyErr_SetString(PyExc_TypeError,
11303 "exception causes must derive from " 11307 PyException_SetCause(value, fixed_cause);
11309 PyErr_SetObject(type, value);
11311 PyThreadState *tstate = PyThreadState_GET();
11312 PyObject* tmp_tb = tstate->curexc_traceback;
11313 if (tb != tmp_tb) {
11315 tstate->curexc_traceback = tb;
11316 Py_XDECREF(tmp_tb);
11320 Py_XDECREF(owned_instance);
11325 static void __Pyx_RaiseArgtupleInvalid(
11326 const char* func_name,
11328 Py_ssize_t num_min,
11329 Py_ssize_t num_max,
11330 Py_ssize_t num_found)
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";
11338 num_expected = num_max;
11339 more_or_less =
"at most";
11342 more_or_less =
"exactly";
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);
11350 static CYTHON_INLINE
int __Pyx_CheckKeywordStrings(
11352 const char* function_name,
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;
11362 while (PyDict_Next(kwdict, &pos, &key, 0)) {
11363 #if PY_MAJOR_VERSION < 3 11364 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
11366 if (unlikely(!PyUnicode_Check(key)))
11367 goto invalid_keyword_type;
11369 if ((!kw_allowed) && unlikely(key))
11370 goto invalid_keyword;
11372 invalid_keyword_type:
11373 PyErr_Format(PyExc_TypeError,
11374 "%.200s() keywords must be strings", function_name);
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));
11383 "%s() got an unexpected keyword argument '%U'",
11384 function_name, key);
11389 static void __Pyx_RaiseDoubleKeywordsError(
11390 const char* func_name,
11393 PyErr_Format(PyExc_TypeError,
11394 #
if PY_MAJOR_VERSION >= 3
11395 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
11397 "%s() got multiple values for keyword argument '%s'", func_name,
11398 PyString_AsString(kw_name));
11402 static int __Pyx_ParseOptionalKeywords(
11404 PyObject **argnames[],
11406 PyObject *values[],
11407 Py_ssize_t num_pos_args,
11408 const char* function_name)
11410 PyObject *key = 0, *value = 0;
11411 Py_ssize_t pos = 0;
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++;
11418 values[name-argnames] = value;
11421 name = first_kw_arg;
11422 #if PY_MAJOR_VERSION < 3 11423 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
11425 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
11426 && _PyString_Eq(**name, key)) {
11427 values[name-argnames] = value;
11432 if (*name)
continue;
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;
11446 if (likely(PyUnicode_Check(key))) {
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 :
11452 PyUnicode_Compare(**name, key);
11453 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
11455 values[name-argnames] = value;
11460 if (*name)
continue;
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 :
11468 PyUnicode_Compare(**argname, key);
11469 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
11470 if (cmp == 0)
goto arg_passed_twice;
11475 goto invalid_keyword_type;
11477 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
11479 goto invalid_keyword;
11484 __Pyx_RaiseDoubleKeywordsError(function_name, key);
11486 invalid_keyword_type:
11487 PyErr_Format(PyExc_TypeError,
11488 "%.200s() keywords must be strings", function_name);
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));
11496 "%s() got an unexpected keyword argument '%U'",
11497 function_name, key);
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);
11508 static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
11509 const char *name,
int exact)
11511 if (unlikely(!type)) {
11512 PyErr_SetString(PyExc_SystemError,
"Missing type object");
11515 if (none_allowed && obj == Py_None)
return 1;
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;
11523 if (likely(PyObject_TypeCheck(obj, type)))
return 1;
11525 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
11529 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
11530 if (unlikely(!type)) {
11531 PyErr_SetString(PyExc_SystemError,
"Missing type object");
11534 if (likely(PyObject_TypeCheck(obj, type)))
11536 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
11537 Py_TYPE(obj)->tp_name, type->tp_name);
11541 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
11543 #if CYTHON_COMPILING_IN_CPYTHON 11544 result = PyDict_GetItem(__pyx_d, name);
11549 result = PyObject_GetItem(__pyx_d, name);
11553 result = __Pyx_GetBuiltinName(name);
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;
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);
11571 #if PY_MAJOR_VERSION < 3 11572 ctx = PyString_FromString(name);
11574 ctx = PyUnicode_FromString(name);
11576 __Pyx_ErrRestore(old_exc, old_val, old_tb);
11578 PyErr_WriteUnraisable(Py_None);
11580 PyErr_WriteUnraisable(ctx);
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;
11592 Py_XINCREF(*value);
11595 PyErr_GetExcInfo(type, value, tb);
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);
11612 PyErr_SetExcInfo(type, value, tb);
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);
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");
11627 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
11628 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
11631 static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
11633 result = __Pyx_PyObject_GetAttrStr(nmspace, name);
11635 result = __Pyx_GetModuleGlobalName(name);
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)
11650 metaclass = tmptype;
11653 if (PyType_IsSubtype(metaclass, tmptype))
11655 if (PyType_IsSubtype(tmptype, metaclass)) {
11656 metaclass = tmptype;
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");
11667 #if PY_MAJOR_VERSION < 3 11668 metaclass = &PyClass_Type;
11670 metaclass = &PyType_Type;
11673 Py_INCREF((PyObject*) metaclass);
11674 return (PyObject*) metaclass;
11677 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
11678 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
11681 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
11683 PyObject *pargs = PyTuple_Pack(2, name, bases);
11684 if (unlikely(!pargs)) {
11688 ns = PyObject_Call(prep, pargs, mkw);
11692 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
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;
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))) {
11725 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
11726 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
11727 Py_XDECREF(owned_metaclass);
11728 if (unlikely(!metaclass))
11730 owned_metaclass = metaclass;
11732 margs = PyTuple_Pack(3, name, bases, dict);
11733 if (unlikely(!margs)) {
11736 result = PyObject_Call(metaclass, margs, mkw);
11739 Py_XDECREF(owned_metaclass);
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;
11749 #if PY_VERSION_HEX < 0x03030000 11750 PyObject *py_import;
11751 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
11758 empty_list = PyList_New(0);
11763 global_dict = PyModule_GetDict(__pyx_m);
11766 empty_dict = PyDict_New();
11769 #if PY_VERSION_HEX >= 0x02050000 11771 #if PY_MAJOR_VERSION >= 3 11773 if (strchr(__Pyx_MODULE_NAME,
'.')) {
11774 #if PY_VERSION_HEX < 0x03030000 11775 PyObject *py_level = PyInt_FromLong(1);
11778 module = PyObject_CallFunctionObjArgs(py_import,
11779 name, global_dict, empty_dict, list, py_level, NULL);
11780 Py_DECREF(py_level);
11782 module = PyImport_ImportModuleLevelObject(
11783 name, global_dict, empty_dict, list, 1);
11786 if (!PyErr_ExceptionMatches(PyExc_ImportError))
11795 #if PY_VERSION_HEX < 0x03030000 11796 PyObject *py_level = PyInt_FromLong(level);
11799 module = PyObject_CallFunctionObjArgs(py_import,
11800 name, global_dict, empty_dict, list, py_level, NULL);
11801 Py_DECREF(py_level);
11803 module = PyImport_ImportModuleLevelObject(
11804 name, global_dict, empty_dict, list, level);
11810 PyErr_SetString(PyExc_RuntimeError,
"Relative import is not supported for Python <=2.4.");
11813 module = PyObject_CallFunctionObjArgs(py_import,
11814 name, global_dict, empty_dict, list, NULL);
11817 #if PY_VERSION_HEX < 0x03030000 11818 Py_XDECREF(py_import);
11820 Py_XDECREF(empty_list);
11821 Py_XDECREF(empty_dict);
11825 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ 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; \ 11838 return (target_type) value; \ 11841 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 11842 #if CYTHON_USE_PYLONG_INTERNALS 11843 #include "longintrepr.h" 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)
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");
11864 if (likely(PyLong_Check(x))) {
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)) {
11871 case 1:
return (
int) ((PyLongObject*)x)->ob_digit[0];
11876 if (unlikely(Py_SIZE(x) < 0)) {
11877 PyErr_SetString(PyExc_OverflowError,
11878 "can't convert negative value to int");
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)
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)) {
11892 case 1:
return +(int) ((PyLongObject*)x)->ob_digit[0];
11893 case -1:
return -(int) ((PyLongObject*)x)->ob_digit[0];
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)
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");
11910 PyObject *v = __Pyx_PyNumber_Int(x);
11911 #if PY_MAJOR_VERSION < 3 11912 if (likely(v) && !PyLong_Check(v)) {
11914 v = PyNumber_Long(tmp);
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);
11933 PyObject *tmp = __Pyx_PyNumber_Int(x);
11934 if (!tmp)
return (
int) -1;
11935 val = __Pyx_PyInt_As_int(tmp);
11941 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(
int16_t value) {
11943 const int is_unsigned = neg_one > const_zero;
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);
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);
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);
11967 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int8_t(
int8_t value) {
11969 const int is_unsigned = neg_one > const_zero;
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);
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);
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);
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;
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);
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);
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);
12019 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(
int32_t value) {
12021 const int is_unsigned = neg_one > const_zero;
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);
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);
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);
12045 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 12046 static PyObject *__Pyx_GetStdout(
void) {
12047 PyObject *f = PySys_GetObject((
char *)
"stdout");
12049 PyErr_SetString(PyExc_RuntimeError,
"lost sys.stdout");
12053 static int __Pyx_Print(PyObject* f, PyObject *arg_tuple,
int newline) {
12056 if (!(f = __Pyx_GetStdout()))
12060 for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
12062 if (PyFile_SoftSpace(f, 1)) {
12063 if (PyFile_WriteString(
" ", f) < 0)
12066 v = PyTuple_GET_ITEM(arg_tuple, i);
12067 if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
12069 if (PyString_Check(v)) {
12070 char *s = PyString_AsString(v);
12071 Py_ssize_t len = PyString_Size(v);
12073 switch (s[len-1]) {
12075 case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
12076 PyFile_SoftSpace(f, 0);
12084 if (PyFile_WriteString(
"\n", f) < 0)
12086 PyFile_SoftSpace(f, 0);
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);
12105 kwargs = PyDict_New();
12106 if (unlikely(!kwargs))
12108 if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
12111 end_string = PyUnicode_FromStringAndSize(
" ", 1);
12112 if (unlikely(!end_string))
12114 if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
12115 Py_DECREF(end_string);
12118 Py_DECREF(end_string);
12120 }
else if (!newline) {
12121 if (unlikely(!__pyx_print_kwargs)) {
12122 __pyx_print_kwargs = PyDict_New();
12123 if (unlikely(!__pyx_print_kwargs))
12125 end_string = PyUnicode_FromStringAndSize(
" ", 1);
12126 if (unlikely(!end_string))
12128 if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
12129 Py_DECREF(end_string);
12132 Py_DECREF(end_string);
12134 kwargs = __pyx_print_kwargs;
12136 result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
12137 if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
12144 if (kwargs != __pyx_print_kwargs)
12145 Py_XDECREF(kwargs);
12150 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 12151 static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
12153 if (!(f = __Pyx_GetStdout()))
12157 if (PyFile_SoftSpace(f, 0)) {
12158 if (PyFile_WriteString(
" ", f) < 0)
12161 if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
12163 if (PyFile_WriteString(
"\n", f) < 0)
12172 return __Pyx_Print(f, NULL, 0);
12175 static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
12177 PyObject* arg_tuple = PyTuple_Pack(1, o);
12178 if (unlikely(!arg_tuple))
12180 res = __Pyx_Print(stream, arg_tuple, 1);
12181 Py_DECREF(arg_tuple);
12186 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(
uint32_t value) {
12188 const int is_unsigned = neg_one > const_zero;
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);
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);
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);
12212 #if CYTHON_CCOMPLEX 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);
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;
12223 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
12224 __pyx_t_float_complex z;
12231 #if CYTHON_CCOMPLEX 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);
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;
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;
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;
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;
12261 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
12262 __pyx_t_float_complex z;
12267 static CYTHON_INLINE
int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
12268 return (a.real == 0) && (a.imag == 0);
12270 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
12271 __pyx_t_float_complex z;
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);
12281 return hypotf(z.real, z.imag);
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) {
12289 float denom = a.real * a.real + a.imag * a.imag;
12290 a.real = a.real / denom;
12291 a.imag = -a.imag / denom;
12294 switch ((
int)b.real) {
12302 z = __Pyx_c_prodf(a, a);
12303 return __Pyx_c_prodf(a, a);
12305 z = __Pyx_c_prodf(a, a);
12306 return __Pyx_c_prodf(z, a);
12308 z = __Pyx_c_prodf(a, a);
12309 return __Pyx_c_prodf(z, z);
12319 r = __Pyx_c_absf(a);
12320 theta = atan2f(a.imag, a.real);
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);
12332 #if CYTHON_CCOMPLEX 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);
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;
12343 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
12344 __pyx_t_double_complex z;
12351 #if CYTHON_CCOMPLEX 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);
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;
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;
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;
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;
12381 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
12382 __pyx_t_double_complex z;
12387 static CYTHON_INLINE
int __Pyx_c_is_zero(__pyx_t_double_complex a) {
12388 return (a.real == 0) && (a.imag == 0);
12390 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
12391 __pyx_t_double_complex z;
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);
12401 return hypot(z.real, z.imag);
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) {
12409 double denom = a.real * a.real + a.imag * a.imag;
12410 a.real = a.real / denom;
12411 a.imag = -a.imag / denom;
12414 switch ((
int)b.real) {
12422 z = __Pyx_c_prod(a, a);
12423 return __Pyx_c_prod(a, a);
12425 z = __Pyx_c_prod(a, a);
12426 return __Pyx_c_prod(z, a);
12428 z = __Pyx_c_prod(a, a);
12429 return __Pyx_c_prod(z, z);
12439 r = __Pyx_c_abs(a);
12440 theta = atan2(a.imag, a.real);
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);
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;
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);
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);
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);
12478 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 12479 #if CYTHON_USE_PYLONG_INTERNALS 12480 #include "longintrepr.h" 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)
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");
12501 if (likely(PyLong_Check(x))) {
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)) {
12508 case 1:
return (
long) ((PyLongObject*)x)->ob_digit[0];
12513 if (unlikely(Py_SIZE(x) < 0)) {
12514 PyErr_SetString(PyExc_OverflowError,
12515 "can't convert negative value to long");
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)
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)) {
12529 case 1:
return +(long) ((PyLongObject*)x)->ob_digit[0];
12530 case -1:
return -(long) ((PyLongObject*)x)->ob_digit[0];
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)
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");
12547 PyObject *v = __Pyx_PyNumber_Int(x);
12548 #if PY_MAJOR_VERSION < 3 12549 if (likely(v) && !PyLong_Check(v)) {
12551 v = PyNumber_Long(tmp);
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);
12570 PyObject *tmp = __Pyx_PyNumber_Int(x);
12571 if (!tmp)
return (
long) -1;
12572 val = __Pyx_PyInt_As_long(tmp);
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]) {
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);
12591 return PyErr_WarnEx(NULL, message, 1);
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);
12605 py_module = PyImport_Import(py_name);
12606 Py_DECREF(py_name);
12609 Py_XDECREF(py_name);
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)
12619 PyObject *py_module = 0;
12620 PyObject *result = 0;
12621 PyObject *py_name = 0;
12623 Py_ssize_t basicsize;
12624 #ifdef Py_LIMITED_API 12625 PyObject *py_basicsize;
12627 py_module = __Pyx_ImportModule(module_name);
12630 py_name = __Pyx_PyIdentifier_FromString(class_name);
12633 result = PyObject_GetAttr(py_module, py_name);
12634 Py_DECREF(py_name);
12636 Py_DECREF(py_module);
12640 if (!PyType_Check(result)) {
12641 PyErr_Format(PyExc_TypeError,
12642 "%.200s.%.200s is not a type object",
12643 module_name, class_name);
12646 #ifndef Py_LIMITED_API 12647 basicsize = ((PyTypeObject *)result)->tp_basicsize;
12649 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
12652 basicsize = PyLong_AsSsize_t(py_basicsize);
12653 Py_DECREF(py_basicsize);
12655 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
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;
12665 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
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);
12674 return (PyTypeObject *)result;
12676 Py_XDECREF(py_module);
12677 Py_XDECREF(result);
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) {
12687 while (start < end) {
12688 mid = (start + end) / 2;
12689 if (code_line < entries[mid].code_line) {
12691 }
else if (code_line > entries[mid].code_line) {
12697 if (code_line <= entries[mid].code_line) {
12703 static PyCodeObject *__pyx_find_code_object(
int code_line) {
12704 PyCodeObject* code_object;
12706 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
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)) {
12713 code_object = __pyx_code_cache.entries[pos].code_object;
12714 Py_INCREF(code_object);
12715 return code_object;
12717 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
12719 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
12720 if (unlikely(!code_line)) {
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);
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;
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)) {
12749 __pyx_code_cache.entries = entries;
12750 __pyx_code_cache.max_count = new_max;
12752 for (i=__pyx_code_cache.count; i>pos; i--) {
12753 entries[i] = entries[i-1];
12755 entries[pos].code_line = code_line;
12756 entries[pos].code_object = code_object;
12757 __pyx_code_cache.count++;
12758 Py_INCREF(code_object);
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);
12773 py_srcfile = PyUnicode_FromString(filename);
12775 if (!py_srcfile)
goto bad;
12777 #if PY_MAJOR_VERSION < 3 12778 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
12780 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
12784 #if PY_MAJOR_VERSION < 3 12785 py_funcname = PyString_FromString(funcname);
12787 py_funcname = PyUnicode_FromString(funcname);
12790 if (!py_funcname)
goto bad;
12791 py_code = __Pyx_PyCode_New(
12808 Py_DECREF(py_srcfile);
12809 Py_DECREF(py_funcname);
12812 Py_XDECREF(py_srcfile);
12813 Py_XDECREF(py_funcname);
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);
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);
12828 py_globals = PyModule_GetDict(__pyx_m);
12829 if (!py_globals)
goto bad;
12830 py_frame = PyFrame_New(
12831 PyThreadState_GET(),
12836 if (!py_frame)
goto bad;
12837 py_frame->f_lineno = py_line;
12838 PyTraceBack_Here(py_frame);
12840 Py_XDECREF(py_code);
12841 Py_XDECREF(py_frame);
12844 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
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);
12852 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
12855 if (t->is_unicode | t->is_str) {
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);
12861 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
12864 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
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));
12877 static CYTHON_INLINE
char* __Pyx_PyObject_AsString(PyObject* o) {
12879 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
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 12884 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12885 __Pyx_sys_getdefaultencoding_not_ascii &&
12887 PyUnicode_Check(o)) {
12888 #if PY_VERSION_HEX < 0x03030000 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 12895 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
12897 for (c = defenc_c; c < end; c++) {
12898 if ((
unsigned char) (*c) >= 128) {
12899 PyUnicode_AsASCIIString(o);
12905 *length = PyBytes_GET_SIZE(defenc);
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);
12914 PyUnicode_AsASCIIString(o);
12918 return PyUnicode_AsUTF8AndSize(o, length);
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);
12933 int r = PyBytes_AsStringAndSize(o, &result, length);
12934 if (unlikely(r < 0)) {
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);
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))
12953 if (PyLong_Check(x))
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) {
12960 res = PyNumber_Int(x);
12962 else if (m && m->nb_long) {
12964 res = PyNumber_Long(x);
12967 if (m && m->nb_int) {
12969 res = PyNumber_Long(x);
12973 #if PY_MAJOR_VERSION < 3 12974 if (!PyInt_Check(res) && !PyLong_Check(res)) {
12976 if (!PyLong_Check(res)) {
12978 PyErr_Format(PyExc_TypeError,
12979 "__%.4s__ returned non-%.4s (type %.200s)",
12980 name, name, Py_TYPE(res)->tp_name);
12985 else if (!PyErr_Occurred()) {
12986 PyErr_SetString(PyExc_TypeError,
12987 "an integer is required");
12991 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 12992 #if CYTHON_USE_PYLONG_INTERNALS 12993 #include "longintrepr.h" 12996 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
12999 #if PY_MAJOR_VERSION < 3 13000 if (likely(PyInt_CheckExact(b)))
13001 return PyInt_AS_LONG(b);
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];
13009 case 1:
return ((PyLongObject*)b)->ob_digit[0];
13013 #if PY_VERSION_HEX < 0x02060000 13014 return PyInt_AsSsize_t(b);
13016 return PyLong_AsSsize_t(b);
13019 x = PyNumber_Index(b);
13021 ival = PyInt_AsSsize_t(x);
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);
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);
13035 return PyInt_FromSize_t(ival);
void freenect_set_video_callback(freenect_device *dev, freenect_video_cb cb)
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)
void freenect_get_mks_accel(freenect_raw_tilt_state *state, double *x, double *y, double *z)
int freenect_stop_video(freenect_device *dev)
int freenect_num_devices(freenect_context *ctx)
int freenect_start_depth(freenect_device *dev)
int freenect_set_led(freenect_device *dev, freenect_led_options option)
int freenect_shutdown(freenect_context *ctx)
int freenect_set_video_mode(freenect_device *dev, const freenect_frame_mode mode)
int freenect_set_tilt_degs(freenect_device *dev, double angle)
void freenect_set_depth_callback(freenect_device *dev, freenect_depth_cb cb)
int freenect_start_video(freenect_device *dev)
double freenect_get_tilt_degs(freenect_raw_tilt_state *state)
freenect_frame_mode freenect_find_video_mode(freenect_resolution res, freenect_video_format fmt)
freenect_frame_mode freenect_get_current_depth_mode(freenect_device *dev)
freenect_frame_mode freenect_find_depth_mode(freenect_resolution res, freenect_depth_format fmt)
void freenect_sync_stop(void)
freenect_raw_tilt_state * freenect_get_tilt_state(freenect_device *dev)
int freenect_update_tilt_state(freenect_device *dev)
int freenect_close_device(freenect_device *dev)
int freenect_set_depth_mode(freenect_device *dev, const freenect_frame_mode mode)
freenect_frame_mode freenect_get_current_video_mode(freenect_device *dev)
int freenect_open_device(freenect_context *ctx, freenect_device **dev, int index)
typedef void(ONI_CALLBACK_TYPE *DeviceConnectedCallback)(const OniDeviceInfo *
static freenect_context * ctx
Data from the tilt motor and accelerometer.
int freenect_sync_get_video(void **video, uint32_t *timestamp, int index, freenect_video_format fmt)
int freenect_stop_depth(freenect_device *dev)
int freenect_process_events(freenect_context *ctx)
freenect_video_format video_format
int freenect_init(freenect_context **ctx, freenect_usb_context *usb_ctx)