summaryrefslogtreecommitdiffstats
path: root/python/astra/CFloat32CustomPython.h
diff options
context:
space:
mode:
Diffstat (limited to 'python/astra/CFloat32CustomPython.h')
-rw-r--r--python/astra/CFloat32CustomPython.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/python/astra/CFloat32CustomPython.h b/python/astra/CFloat32CustomPython.h
new file mode 100644
index 0000000..d8593fc
--- /dev/null
+++ b/python/astra/CFloat32CustomPython.h
@@ -0,0 +1,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;
+}; \ No newline at end of file