blob: d8593fcfd2ebad6cc7f5bbcae1ea8c4a511f2cac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
class CFloat32CustomPython : public astra::CFloat32CustomMemory {
public:
CFloat32CustomPython(PyObject * arrIn)
{
arr = arrIn;
// Set pointer to numpy data pointer
m_fPtr = (float *)PyArray_DATA(arr);
// Increase reference count since ASTRA has a reference
Py_INCREF(arr);
}
virtual ~CFloat32CustomPython() {
// Decrease reference count since ASTRA object is destroyed
Py_DECREF(arr);
}
private:
PyObject* arr;
};
|