Merge pull request #18566 from mtfrctl:mat-objc-swift-data-pointer

This commit is contained in:
Alexander Alekhin 2020-10-14 16:59:44 +00:00
commit 57c894f44d
2 changed files with 5 additions and 0 deletions

View File

@ -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;

View File

@ -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();
}