-
Notifications
You must be signed in to change notification settings - Fork 11
/
gen.c
126 lines (126 loc) · 4.88 KB
/
gen.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#include <Python.h>
#include <structmember.h>
#include <k4a/k4a.h>
#include "gen.h"
static PyTypeObject py_k4a_device_configuration_tType =
{
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "k4a.py_k4a_device_configuration_t",
.tp_doc = "Kinect for Azure generated py_k4a_device_configuration_t",
.tp_basicsize = sizeof(py_k4a_device_configuration_t),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_new = PyType_GenericNew,
};
static PyTypeObject py_k4a_calibration_extrinsics_tType =
{
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "k4a.py_k4a_calibration_extrinsics_t",
.tp_doc = "Kinect for Azure generated py_k4a_calibration_extrinsics_t",
.tp_basicsize = sizeof(py_k4a_calibration_extrinsics_t),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_new = PyType_GenericNew,
};
static PyTypeObject py_k4a_calibration_intrinsics_tType =
{
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "k4a.py_k4a_calibration_intrinsics_t",
.tp_doc = "Kinect for Azure generated py_k4a_calibration_intrinsics_t",
.tp_basicsize = sizeof(py_k4a_calibration_intrinsics_t),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_new = PyType_GenericNew,
};
static PyTypeObject py_k4a_calibration_camera_tType =
{
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "k4a.py_k4a_calibration_camera_t",
.tp_doc = "Kinect for Azure generated py_k4a_calibration_camera_t",
.tp_basicsize = sizeof(py_k4a_calibration_camera_t),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_new = PyType_GenericNew,
};
static PyTypeObject py_k4a_calibration_tType =
{
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "k4a.py_k4a_calibration_t",
.tp_doc = "Kinect for Azure generated py_k4a_calibration_t",
.tp_basicsize = sizeof(py_k4a_calibration_t),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_new = PyType_GenericNew,
};
static PyTypeObject py_k4a_version_tType =
{
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "k4a.py_k4a_version_t",
.tp_doc = "Kinect for Azure generated py_k4a_version_t",
.tp_basicsize = sizeof(py_k4a_version_t),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_new = PyType_GenericNew,
};
static PyTypeObject py_k4a_hardware_version_tType =
{
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "k4a.py_k4a_hardware_version_t",
.tp_doc = "Kinect for Azure generated py_k4a_hardware_version_t",
.tp_basicsize = sizeof(py_k4a_hardware_version_t),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_new = PyType_GenericNew,
};
static PyTypeObject py_k4a_imu_sample_tType =
{
PyVarObject_HEAD_INIT(NULL, 0)
.tp_name = "k4a.py_k4a_imu_sample_t",
.tp_doc = "Kinect for Azure generated py_k4a_imu_sample_t",
.tp_basicsize = sizeof(py_k4a_imu_sample_t),
.tp_itemsize = 0,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_new = PyType_GenericNew,
};
bool initGenTypes() {
if (PyType_Ready(&py_k4a_device_configuration_tType) < 0) return false;
if (PyType_Ready(&py_k4a_calibration_extrinsics_tType) < 0) return false;
if (PyType_Ready(&py_k4a_calibration_intrinsics_tType) < 0) return false;
if (PyType_Ready(&py_k4a_calibration_camera_tType) < 0) return false;
if (PyType_Ready(&py_k4a_calibration_tType) < 0) return false;
if (PyType_Ready(&py_k4a_version_tType) < 0) return false;
if (PyType_Ready(&py_k4a_hardware_version_tType) < 0) return false;
if (PyType_Ready(&py_k4a_imu_sample_tType) < 0) return false;
return true;
}
bool addGenTypes(PyObject* mod) {
Py_INCREF(&py_k4a_device_configuration_tType);
Py_INCREF(&py_k4a_calibration_extrinsics_tType);
Py_INCREF(&py_k4a_calibration_intrinsics_tType);
Py_INCREF(&py_k4a_calibration_camera_tType);
Py_INCREF(&py_k4a_calibration_tType);
Py_INCREF(&py_k4a_version_tType);
Py_INCREF(&py_k4a_hardware_version_tType);
Py_INCREF(&py_k4a_imu_sample_tType);
if (
PyModule_AddObject(mod, "py_k4a_device_configuration_t", (PyObject *)&py_k4a_device_configuration_tType) < 0 ||
PyModule_AddObject(mod, "py_k4a_calibration_extrinsics_t", (PyObject *)&py_k4a_calibration_extrinsics_tType) < 0 ||
PyModule_AddObject(mod, "py_k4a_calibration_intrinsics_t", (PyObject *)&py_k4a_calibration_intrinsics_tType) < 0 ||
PyModule_AddObject(mod, "py_k4a_calibration_camera_t", (PyObject *)&py_k4a_calibration_camera_tType) < 0 ||
PyModule_AddObject(mod, "py_k4a_calibration_t", (PyObject *)&py_k4a_calibration_tType) < 0 ||
PyModule_AddObject(mod, "py_k4a_version_t", (PyObject *)&py_k4a_version_tType) < 0 ||
PyModule_AddObject(mod, "py_k4a_hardware_version_t", (PyObject *)&py_k4a_hardware_version_tType) < 0 ||
PyModule_AddObject(mod, "py_k4a_imu_sample_t", (PyObject *)&py_k4a_imu_sample_tType) < 0 ||
false) {
Py_DECREF(&py_k4a_device_configuration_tType);
Py_DECREF(&py_k4a_calibration_extrinsics_tType);
Py_DECREF(&py_k4a_calibration_intrinsics_tType);
Py_DECREF(&py_k4a_calibration_camera_tType);
Py_DECREF(&py_k4a_calibration_tType);
Py_DECREF(&py_k4a_version_tType);
Py_DECREF(&py_k4a_hardware_version_tType);
Py_DECREF(&py_k4a_imu_sample_tType);
return false;
}
return true;
}