Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

komakai
Copy link
Contributor

@komakai komakai commented Apr 19, 2023

  • I agree to contribute to the project under Apache 2 License.
  • 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
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work

Fix for #23512

  • refactor Mat+Converters and Mat+Quicklook modules such that the functions they provide are now included directly in the Mat interface
  • add a series of defines of the form AVAILABLE_XXX for each Objective-C/Swift module that is enabled in the build in order to correctly handle the case that imgcodecs is not available

@asmorkalov asmorkalov requested a review from VadimLevin April 19, 2023 13:06
@asmorkalov asmorkalov added this to the 4.8.0 milestone Apr 19, 2023
@asmorkalov asmorkalov changed the title Fix "unrecognized selector" issue in Objective-C/Swift bindingd Fix "unrecognized selector" issue in Objective-C/Swift bindings Apr 20, 2023
Copy link
Contributor

@VadimLevin VadimLevin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Availability check looks good, but what is the point behind switching from extension to separate class for MatConverters?

@komakai
Copy link
Contributor Author

komakai commented Apr 22, 2023

@VadimLevin thanks for your question.
As described in #23512 we want to solve the constantly occurring problem of "Unrecognized selector" - to do this we need to move functions out of a category into the Mat class itself.
But these functions rely on code that is in imgcodecs module - so I kept the main bodies of the implementations in the imgcodes module. The reason to change the names from Mat+Converters to MatConverters and from Mat+Quicklook to MatQuicklook is Objective-C file naming convention. A file named like Mat+Converters indicates the file implements a category Converters on the class Mat. Because we are not now implementing a category I changed the name so as not to break the convention. I hope that makes sense

@VadimLevin
Copy link
Contributor

Yep, thanks for explanation!

@asmorkalov asmorkalov merged commit a4a9f56 into opencv:4.x Apr 24, 2023
@asmorkalov asmorkalov mentioned this pull request May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants