Python bindings: added std::vector< std::pair< int, double > > type read support
This commit is contained in:
parent
764a1f5947
commit
8011be2810
@ -967,6 +967,24 @@ template<typename _Tp> static inline PyObject* pyopencv_from_generic_vec(const s
|
||||
return seq;
|
||||
}
|
||||
|
||||
template<>
|
||||
PyObject* pyopencv_from(const std::pair<int, double>& src)
|
||||
{
|
||||
return Py_BuildValue("(id)", src.first, src.second);
|
||||
}
|
||||
|
||||
template<typename _Tp, typename _Tr> struct pyopencvVecConverter<std::pair<_Tp, _Tr> >
|
||||
{
|
||||
static bool to(PyObject* obj, std::vector<std::pair<_Tp, _Tr> >& value, const ArgInfo info)
|
||||
{
|
||||
return pyopencv_to_generic_vec(obj, value, info);
|
||||
}
|
||||
|
||||
static PyObject* from(const std::vector<std::pair<_Tp, _Tr> >& value)
|
||||
{
|
||||
return pyopencv_from_generic_vec(value);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename _Tp> struct pyopencvVecConverter<std::vector<_Tp> >
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user