Merge pull request #26640 from vrabaud:opencv_js3

js: fix generation of "const const" in code #26640

### 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
- [ ] 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.
- [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Vincent Rabaud 2024-12-19 05:59:01 +01:00 committed by GitHub
parent 3fbaad36d7
commit 79d019b4f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -248,16 +248,17 @@ class ArgInfo(object):
self.const = True
elif m == "/Ref":
self.reference = True
if self.tp == "Mat":
if self.outputarg:
self.tp = "cv::Mat&"
elif self.inputarg:
self.tp = "const cv::Mat&"
if self.tp == "vector_Mat":
if self.outputarg:
self.tp = "std::vector<cv::Mat>&"
elif self.inputarg:
self.tp = "const std::vector<cv::Mat>&"
if self.tp == "Mat" and (self.inputarg or self.outputarg):
self.tp = "cv::Mat&"
if self.inputarg and not self.outputarg:
self.const = True
if self.tp == "vector_Mat" and (self.inputarg or self.outputarg):
self.tp = "std::vector<cv::Mat>&"
if self.reference and not self.const:
self.inputarg = False
self.outputarg = True
elif self.inputarg and not self.outputarg:
self.const = True
self.tp = handle_vector(self.tp).strip()
if self.const:
self.tp = "const " + self.tp