Skip to content

Commit 0cd850f

Browse files
committed
vision: Allow including from OpenCV's videoio, for 3.x+
This commit doesn't add buildsystem support yet.
1 parent eed0834 commit 0cd850f

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

panda/src/vision/openCVTexture.cxx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,26 @@
2222
#include "bamCacheRecord.h"
2323

2424
// This symbol is predefined by the Panda3D build system to select whether we
25-
// are using the OpenCV 2.3 or later interface, or if it is not defined, we
26-
// are using the original interface.
27-
#ifdef OPENCV_VER_23
25+
// are using the OpenCV 3.x or later interface.
26+
#if defined(OPENCV_VER_3)
27+
28+
#include <opencv2/core.hpp>
29+
#include <opencv2/videoio/videoio_c.h>
30+
31+
// This checks for 2.3 or later.
32+
#elif defined(OPENCV_VER_23)
2833

2934
#include <opencv2/core/core.hpp>
30-
// #include <opencv2videovideo.hpp>
3135
#include <opencv2/highgui/highgui.hpp>
3236

37+
// If neither of those are predefined, assume 1.x.
3338
#else
39+
3440
#include <cv.h>
3541
#include <cxcore.h>
3642
#include <highgui.h>
3743

38-
#endif // OPENCV_VER_23
44+
#endif // OPENCV_VER_3
3945

4046
TypeHandle OpenCVTexture::_type_handle;
4147

0 commit comments

Comments
 (0)