Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
1caca211
Commit
1caca211
authored
Sep 05, 2017
by
Lewis B
Committed by
Alexander Alekhin
Sep 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge pull request #8934 from lewisjb:python-classes
* Refactor Python Classes
parent
42fbbfec
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
cv2.cpp
modules/python/src2/cv2.cpp
+11
-5
gen2.py
modules/python/src2/gen2.py
+0
-0
No files found.
modules/python/src2/cv2.cpp
View file @
1caca211
...
...
@@ -1609,14 +1609,20 @@ void initcv2()
return
;
#endif
#if PY_MAJOR_VERSION >= 3
Py_INCREF
(
&
cv2_UMatWrapperType
);
#define PUBLISH_OBJECT(name, type) Py_INCREF(&type);\
PyModule_AddObject(m, name, (PyObject *)&type);
#else
// Unrolled Py_INCREF(&cv2_UMatWrapperType) without (PyObject*) cast
// due to "warning: dereferencing type-punned pointer will break strict-aliasing rules"
_Py_INC_REFTOTAL
_Py_REF_DEBUG_COMMA
(
&
cv2_UMatWrapperType
)
->
ob_refcnt
++
;
// Unrolled Py_INCREF(&type) without (PyObject*) cast
// due to "warning: dereferencing type-punned pointer will break strict-aliasing rules"
#define PUBLISH_OBJECT(name, type) _Py_INC_REFTOTAL _Py_REF_DEBUG_COMMA (&type)->ob_refcnt++;\
PyModule_AddObject(m, name, (PyObject *)&type);
#endif
PyModule_AddObject
(
m
,
"UMat"
,
(
PyObject
*
)
&
cv2_UMatWrapperType
);
PUBLISH_OBJECT
(
"UMat"
,
cv2_UMatWrapperType
);
#include "pyopencv_generated_type_publish.h"
#define PUBLISH(I) PyDict_SetItemString(d, #I, PyInt_FromLong(I))
//#define PUBLISHU(I) PyDict_SetItemString(d, #I, PyLong_FromUnsignedLong(I))
...
...
modules/python/src2/gen2.py
View file @
1caca211
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment