mirror of
https://github.com/opencv/opencv.git
synced 2024-11-25 19:50:38 +08:00
Add data pointer bridge method to Mat for Objective-C/Swift
This commit is contained in:
parent
199687a1c5
commit
16561ed71e
@ -97,6 +97,7 @@ CV_EXPORTS @interface Mat : NSObject
|
||||
- (void)createEx:(NSArray<NSNumber*>*)sizes type:(int)type NS_SWIFT_NAME(create(sizes:type:));
|
||||
- (void)copySize:(Mat*)mat;
|
||||
- (Mat*)cross:(Mat*)mat;
|
||||
- (unsigned char*)dataPtr NS_SWIFT_NAME(dataPointer());
|
||||
- (int)depth;
|
||||
- (Mat*)diag:(int)diagonal;
|
||||
- (Mat*)diag;
|
||||
|
@ -286,6 +286,10 @@ static bool updateIdx(cv::Mat* mat, std::vector<int>& indices, int inc) {
|
||||
return [[Mat alloc] initWithNativeMat:new cv::Mat(_nativePtr->cross(*(cv::Mat*)mat.nativePtr))];
|
||||
}
|
||||
|
||||
- (unsigned char*)dataPtr {
|
||||
return _nativePtr->data;
|
||||
}
|
||||
|
||||
- (int)depth {
|
||||
return _nativePtr->depth();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user