Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork56.4k
Mat conversions for macOS/AppKit#18547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…le_conversions.h, apple_conversions. Add macosx_conversions.mm
alalek left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thank you for contribution!
Please take a look on comments below.
| // | ||
| // | ||
| // License Agreement | ||
| // For Open Source Computer Vision Library |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Please use short license header:https://github.com/opencv/opencv/wiki/Coding_Style_Guide#file-structure
// This file is part of OpenCV project.// It is subject to the license terms in the LICENSE file found in the top-level directory// of this distribution and at http://opencv.org/license.html.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
🙆♂️
42a685c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thank you for updates!
Please make similar update of license headers of new files in this PR.
Please remove empty first line in this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Uh oh!
There was an error while loading.Please reload this page.
| #import <AVFoundation/AVFoundation.h> | ||
| #import <ImageIO/ImageIO.h> | ||
| #include "opencv2/core.hpp" | ||
| #include "precomp.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
precomp.hpp
Please don't use this from header files. Move into .mm files instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thank you. I moved it.
edfe785
Uh oh!
There was an error while loading.Please reload this page.
| CGColorSpaceRef colorSpace; | ||
| if (image.elemSize() == 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
.elemSize() =>.channels()
+CV_CheckDepth(image.depth(), CV_8U, ""); check on the first line.
OK, I see this code is just moved.
Uh oh!
There was an error while loading.Please reload this page.
komakai commentedOct 10, 2020
@mtfrctl thanks for this - this is a great feature. |
mtfrctl commentedOct 10, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@komakai Thank you! Regarding the flag, people who come to check here will also check these@komakai and@treastrain conversations (#17532#18023), but it would be nice in the future so that it can be used immediately without being aware of these things ⭐ |
mtfrctl commentedOct 11, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@alalek By the way, I would like to add the following method to |
alalek commentedOct 11, 2020
If there is no strong dependency between patches, then separate PR is better. |
mtfrctl commentedOct 11, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
alalek left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
komakai commentedOct 15, 2020
@mtfrctl keep the contributions coming! |
Mat conversions for macOS/AppKit* Extract CoreGraphics conversion logics from ios_conversions.mm to apple_conversions.h, apple_conversions. Add macosx_conversions.mm* Add macosx.h* Add Mat+Conversions.h and Mat+Conversions.mm* Delete duplicated declaration from apple_conversion.mm* Use short license header* Add compile guard* Delete unused imports* Move precomp.hpp import from header to implementation* Add macosx.h to skip headers* Fix compile guard condition* Use short license header* Remove commented out unused code
Uh oh!
There was an error while loading.Please reload this page.
This PR solves#18546.
It consists
Usage example in Swift:
※ Don't forget to set the
-all_loadflag to "Other Linker Flags" in "Build Settings" when using!#17532Pull Request Readiness Checklist
See details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request