| 
									
										
										
										
											2023-07-21 17:52:30 +02:00
										 |  |  | //
 | 
					
						
							|  |  |  | //  VisionCameraProxy.h
 | 
					
						
							|  |  |  | //  VisionCamera
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | //  Created by Marc Rousavy on 20.07.23.
 | 
					
						
							|  |  |  | //  Copyright © 2023 mrousavy. All rights reserved.
 | 
					
						
							|  |  |  | //
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #import <Foundation/Foundation.h>
 | 
					
						
							|  |  |  | #import <React/RCTBridge.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  | #import "WKTJsiWorkletContext.h"
 | 
					
						
							|  |  |  | #import <ReactCommon/CallInvoker.h>
 | 
					
						
							| 
									
										
										
										
											2023-09-01 12:58:32 +02:00
										 |  |  | #import <jsi/jsi.h>
 | 
					
						
							| 
									
										
										
										
											2023-07-21 17:52:30 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | using namespace facebook; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-01 12:58:32 +02:00
										 |  |  | class VisionCameraProxy : public jsi::HostObject { | 
					
						
							| 
									
										
										
										
											2023-07-21 17:52:30 +02:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2023-09-01 19:39:25 +02:00
										 |  |  |   explicit VisionCameraProxy(jsi::Runtime& runtime, std::shared_ptr<react::CallInvoker> callInvoker); | 
					
						
							| 
									
										
										
										
											2023-07-21 17:52:30 +02:00
										 |  |  |   ~VisionCameraProxy(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |   std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override; | 
					
						
							|  |  |  |   jsi::Value get(jsi::Runtime& runtime, const jsi::PropNameID& name) override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-12 16:00:36 +01:00
										 |  |  |   jsi::Runtime& getWorkletRuntime() { | 
					
						
							|  |  |  |     return _workletContext->getWorkletRuntime(); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-07-21 17:52:30 +02:00
										 |  |  | private: | 
					
						
							|  |  |  |   void setFrameProcessor(jsi::Runtime& runtime, int viewTag, const jsi::Object& frameProcessor); | 
					
						
							|  |  |  |   void removeFrameProcessor(jsi::Runtime& runtime, int viewTag); | 
					
						
							| 
									
										
										
										
											2023-10-19 11:19:47 +02:00
										 |  |  |   jsi::Value initFrameProcessorPlugin(jsi::Runtime& runtime, std::string name, const jsi::Object& options); | 
					
						
							| 
									
										
										
										
											2023-07-21 17:52:30 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |   std::shared_ptr<RNWorklet::JsiWorkletContext> _workletContext; | 
					
						
							|  |  |  |   std::shared_ptr<react::CallInvoker> _callInvoker; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-16 20:02:03 +01:00
										 |  |  | NS_ASSUME_NONNULL_BEGIN | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-12 16:00:36 +01:00
										 |  |  | @interface VisionCameraProxyHolder : NSObject | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-16 20:02:03 +01:00
										 |  |  | - (_Nonnull instancetype)initWithProxy:(void*)proxy; | 
					
						
							| 
									
										
										
										
											2024-01-12 16:00:36 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifdef __cplusplus
 | 
					
						
							| 
									
										
										
										
											2024-01-16 20:02:03 +01:00
										 |  |  | - (VisionCameraProxy*)proxy; | 
					
						
							| 
									
										
										
										
											2024-01-12 16:00:36 +01:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-07-21 17:52:30 +02:00
										 |  |  | @interface VisionCameraInstaller : NSObject | 
					
						
							| 
									
										
										
										
											2024-01-12 16:00:36 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-01-16 20:02:03 +01:00
										 |  |  | + (BOOL)installToBridge:(RCTBridge*)bridge; | 
					
						
							| 
									
										
										
										
											2024-01-12 16:00:36 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-07-21 17:52:30 +02:00
										 |  |  | @end | 
					
						
							| 
									
										
										
										
											2024-01-16 20:02:03 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | NS_ASSUME_NONNULL_END |