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

pull/18598/head
Alexander Alekhin 4 years ago
commit 57c894f44d
  1. 1
      modules/core/misc/objc/common/Mat.h
  2. 4
      modules/core/misc/objc/common/Mat.mm

@ -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…
Cancel
Save