Skip to content

Improvements/fixes for unsigned type handling in Swift/Kotlin#20318

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
komakai:better-unsigned-type-support
Jun 28, 2021
Merged

Improvements/fixes for unsigned type handling in Swift/Kotlin#20318
opencv-pushbot merged 1 commit intoopencv:masterfrom
komakai:better-unsigned-type-support

Conversation

@komakai
Copy link
Copy Markdown
Contributor

@komakai komakai commented Jun 27, 2021

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • 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 other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • The feature is well documented and sample code can be built with the project CMake

On Java there are no signed type so the Java binding just handles CV_8U as CV_8S and CV_16U as CV_16S
The Objective-C/Swift binding mostly just followed the Java binding as much as possible so the original implementation also does not have good handling for CV_8U and CV_16U.
This PR:

  • adds Mat.put/Mat.get functions for Swift/Kotlin using the relevant unsigned types (UInt8/Uint16/UByte/UShort)
  • updates other functions to use the new Mat.put/Mat.get functions
  • fixes a bug in the Objective-C [Mat put:(int)row col:(int)col data:(NSArray<NSNumber*>*)data] implementation
  • adds tests for the new unsigned put/get functions on Swift
force_builders=docs,ios,Custom Mac
buildworker:Mac=macosx-1
buildworker:iOS=macosx-2
build_image:Custom Mac=osx_framework-test
buildworker:Custom Mac=macosx-1
allow_multiple_commits=1

Copy link
Copy Markdown
Member

@alalek alalek left a 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!

@opencv-pushbot opencv-pushbot merged commit 4281062 into opencv:master Jun 28, 2021
@alalek alalek mentioned this pull request Oct 15, 2021
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