30 #ifndef _D_NUMPY_INTERFACE_HPP
31 #define _D_NUMPY_INTERFACE_HPP
33 #include "Core/include/DNumpy.h"
34 #include "Core/include/private/DImage.hxx"
35 #include "Core/include/private/DSharedImage.hpp"
58 BaseObject::className =
"NumpyInt";
61 PyArrayObject *arr = (PyArrayObject *) (obj);
63 int dim = PyArray_NDIM(arr);
64 npy_intp *dims = PyArray_DIMS(arr);
66 T *data = (T *) PyArray_DATA(arr);
68 PyArray_Descr *descr = PyArray_DESCR(arr);
69 if (descr->type_num != getNumpyType(*
this)) {
70 ERR_MSG(
"Wrong data type");
75 this->attach(data, dims[0], dims[1], dims[2]);
77 this->attach(data, dims[0], dims[1]);
79 this->attach(data, dims[0], 1);
Base Smil Object.
Definition: DBaseObject.h:52
Numpy Array Interface.
Definition: DNumpyInterface.hpp:51
Image that uses an existing (1D) data pointer.
Definition: DSharedImage.hpp:51
NumpyInt(PyObject *obj)
Constructor.
Definition: DNumpyInterface.hpp:56