cv2.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef CV2_HPP
  2. #define CV2_HPP
  3. //warning number '5033' not a valid compiler warning in vc12
  4. #if defined(_MSC_VER) && (_MSC_VER > 1800)
  5. // eliminating duplicated round() declaration
  6. #define HAVE_ROUND 1
  7. #pragma warning(push)
  8. #pragma warning(disable:5033) // 'register' is no longer a supported storage class
  9. #endif
  10. // #define CVPY_DYNAMIC_INIT
  11. // #define Py_DEBUG
  12. #if defined(CVPY_DYNAMIC_INIT) && !defined(Py_DEBUG)
  13. # define Py_LIMITED_API 0x03030000
  14. #endif
  15. #include <cmath>
  16. #include <Python.h>
  17. #include <limits>
  18. #if PY_MAJOR_VERSION < 3
  19. #undef CVPY_DYNAMIC_INIT
  20. #else
  21. #define CV_PYTHON_3 1
  22. #endif
  23. #if defined(_MSC_VER) && (_MSC_VER > 1800)
  24. #pragma warning(pop)
  25. #endif
  26. #define MODULESTR "cv2"
  27. #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
  28. #include <numpy/ndarrayobject.h>
  29. #include "pycompat.hpp"
  30. class ArgInfo
  31. {
  32. public:
  33. const char* name;
  34. bool outputarg;
  35. // more fields may be added if necessary
  36. ArgInfo(const char* name_, bool outputarg_) : name(name_), outputarg(outputarg_) {}
  37. private:
  38. ArgInfo(const ArgInfo&) = delete;
  39. ArgInfo& operator=(const ArgInfo&) = delete;
  40. };
  41. #endif // CV2_HPP