aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/sbkarrayconverter.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-07-07 10:54:28 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-08-03 06:21:19 +0000
commit58a93d240c5bdd3bc60ccddbc31676bd0fa2eae3 (patch)
tree18ad59ef9241a444a2605a73d4300cc65d55158c /sources/shiboken2/libshiboken/sbkarrayconverter.cpp
parent1578d14d1693122d4bcacede0d77527d8e898629 (diff)
Add numpy support
Add simple array converters giving access to NumPy arrays. Task-number: PYSIDE-354 Task-number: PYSIDE-516 Change-Id: I2446b0f1ef98eaf12df95e4bd0e03d73e0cd7126 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/libshiboken/sbkarrayconverter.cpp')
-rw-r--r--sources/shiboken2/libshiboken/sbkarrayconverter.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/sources/shiboken2/libshiboken/sbkarrayconverter.cpp b/sources/shiboken2/libshiboken/sbkarrayconverter.cpp
index 39b4ebbf..c2201570 100644
--- a/sources/shiboken2/libshiboken/sbkarrayconverter.cpp
+++ b/sources/shiboken2/libshiboken/sbkarrayconverter.cpp
@@ -242,6 +242,10 @@ static PythonToCppFunc sequenceToCppDoubleArrayCheck(PyObject *pyIn, int dim1, i
return floatArrayCheck(pyIn, dim1) ? sequenceToCppDoubleArray : nullptr;
}
+#ifdef HAVE_NUMPY
+void initNumPyArrayConverters();
+#endif
+
void initArrayConverters()
{
SbkArrayConverter **start = &ArrayTypeConverters[0][0];
@@ -263,6 +267,10 @@ void initArrayConverters()
createArrayConverter(sequenceToCppLongLongArrayCheck);
ArrayTypeConverters[SBK_UNSIGNEDLONGLONG_ARRAY_IDX][0] =
createArrayConverter(sequenceToCppUnsignedLongLongArrayCheck);
+
+#ifdef HAVE_NUMPY
+ initNumPyArrayConverters();
+#endif
}
SbkArrayConverter *arrayTypeConverter(int index, int dimension)