From fdc7cb6dc1be48b26e2f58965903260bac7c6d15 Mon Sep 17 00:00:00 2001 From: utibenkei Date: Mon, 1 Apr 2024 22:12:19 +0900 Subject: [PATCH] fix build of dynamic framework for visionos --- modules/core/misc/objc/common/Mat.h | 4 ++-- modules/core/misc/objc/common/Mat.mm | 2 +- modules/imgcodecs/src/ios_conversions.mm | 2 +- modules/videoio/src/cap_avfoundation.mm | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/core/misc/objc/common/Mat.h b/modules/core/misc/objc/common/Mat.h index 42d4689e8f..04fc8da82c 100644 --- a/modules/core/misc/objc/common/Mat.h +++ b/modules/core/misc/objc/common/Mat.h @@ -15,7 +15,7 @@ #import #ifdef AVAILABLE_IMGCODECS -#if TARGET_OS_IPHONE +#if TARGET_OS_IPHONE || TARGET_OS_VISION #import #elif TARGET_OS_MAC #import @@ -197,7 +197,7 @@ CV_EXPORTS @interface Mat : NSObject - (instancetype)initWithCGImage:(CGImageRef)image; - (instancetype)initWithCGImage:(CGImageRef)image alphaExist:(BOOL)alphaExist; -#if TARGET_OS_IPHONE +#if TARGET_OS_IPHONE || TARGET_OS_VISION - (UIImage*)toUIImage; - (instancetype)initWithUIImage:(UIImage*)image; diff --git a/modules/core/misc/objc/common/Mat.mm b/modules/core/misc/objc/common/Mat.mm index 80ada0b930..54387a4772 100644 --- a/modules/core/misc/objc/common/Mat.mm +++ b/modules/core/misc/objc/common/Mat.mm @@ -951,7 +951,7 @@ template int putData(NSArray* indices, cv::Mat* mat, int return [MatConverters convertCGImageRefToMat:image alphaExist:alphaExist]; } -#if TARGET_OS_IPHONE +#if TARGET_OS_IPHONE || TARGET_OS_VISION -(UIImage*)toUIImage { return [MatConverters converMatToUIImage:self]; diff --git a/modules/imgcodecs/src/ios_conversions.mm b/modules/imgcodecs/src/ios_conversions.mm index 7992325d77..5fea686643 100644 --- a/modules/imgcodecs/src/ios_conversions.mm +++ b/modules/imgcodecs/src/ios_conversions.mm @@ -40,7 +40,7 @@ // //M*/ #include -#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST +#if (TARGET_OS_IOS || TARGET_OS_VISION) && !TARGET_OS_MACCATALYST #import #include "apple_conversions.h" diff --git a/modules/videoio/src/cap_avfoundation.mm b/modules/videoio/src/cap_avfoundation.mm index 0853e57255..2df990392f 100644 --- a/modules/videoio/src/cap_avfoundation.mm +++ b/modules/videoio/src/cap_avfoundation.mm @@ -221,18 +221,18 @@ cv::Ptr cv::create_AVFoundation_capture_file(const std::strin } -#if !TARGET_OS_VISION cv::Ptr cv::create_AVFoundation_capture_cam(int index) { +#if !TARGET_OS_VISION CvCaptureCAM* retval = new CvCaptureCAM(index); if (retval->didStart()) return cv::makePtr(retval); delete retval; +#endif return 0; } -#endif cv::Ptr cv::create_AVFoundation_writer(const std::string& filename, int fourcc, double fps, const cv::Size &frameSize,