From 2fc7d219714fc7dee50446b47cac5207ab474484 Mon Sep 17 00:00:00 2001 From: Vadim Levin Date: Fri, 21 Jul 2023 14:57:32 +0300 Subject: [PATCH] Merge pull request #24029 from VadimLevin:dev/vlevin/python-add-cuda-stream-to-simple-types feat: add cuda_Stream and cuda_GpuMat to simple types mapping #24029 This patch fixes usage of `cuda::Stream` in function arguments. Affected modules: `cudacodec`: [`using namespace cuda`](https://github.com/opencv/opencv_contrib/blob/9dfe233020f669f17021dfc456fe77531e776b74/modules/cudacodec/include/opencv2/cudacodec.hpp#L62) in public `cudacodec.hpp` header can be removed after merge of the patch. ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake --- modules/python/src2/gen2.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/python/src2/gen2.py b/modules/python/src2/gen2.py index 0ba643f12b..fdcae20187 100755 --- a/modules/python/src2/gen2.py +++ b/modules/python/src2/gen2.py @@ -231,6 +231,8 @@ simple_argtype_mapping = { "c_string": ArgTypeInfo("char*", FormatStrings.string, '(char*)""'), "string": ArgTypeInfo("std::string", FormatStrings.object, None, True), "Stream": ArgTypeInfo("Stream", FormatStrings.object, 'Stream::Null()', True), + "cuda_Stream": ArgTypeInfo("cuda::Stream", FormatStrings.object, "cuda::Stream::Null()", True), + "cuda_GpuMat": ArgTypeInfo("cuda::GpuMat", FormatStrings.object, "cuda::GpuMat()", True), "UMat": ArgTypeInfo("UMat", FormatStrings.object, 'UMat()', True), # FIXIT: switch to CV_EXPORTS_W_SIMPLE as UMat is already a some kind of smart pointer }