2023-07-21 09:52:30 -06: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 04:58:32 -06:00
|
|
|
#import <jsi/jsi.h>
|
2023-07-21 09:52:30 -06:00
|
|
|
|
|
|
|
using namespace facebook;
|
|
|
|
|
2023-09-01 04:58:32 -06:00
|
|
|
class VisionCameraProxy : public jsi::HostObject {
|
2023-07-21 09:52:30 -06:00
|
|
|
public:
|
2023-09-01 11:39:25 -06:00
|
|
|
explicit VisionCameraProxy(jsi::Runtime& runtime, std::shared_ptr<react::CallInvoker> callInvoker);
|
2023-07-21 09:52:30 -06:00
|
|
|
~VisionCameraProxy();
|
|
|
|
|
|
|
|
public:
|
|
|
|
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override;
|
|
|
|
jsi::Value get(jsi::Runtime& runtime, const jsi::PropNameID& name) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void setFrameProcessor(jsi::Runtime& runtime, int viewTag, const jsi::Object& frameProcessor);
|
|
|
|
void removeFrameProcessor(jsi::Runtime& runtime, int viewTag);
|
2023-10-19 03:19:47 -06:00
|
|
|
jsi::Value initFrameProcessorPlugin(jsi::Runtime& runtime, std::string name, const jsi::Object& options);
|
2023-07-21 09:52:30 -06:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::shared_ptr<RNWorklet::JsiWorkletContext> _workletContext;
|
|
|
|
std::shared_ptr<react::CallInvoker> _callInvoker;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
@interface VisionCameraInstaller : NSObject
|
|
|
|
+ (BOOL)installToBridge:(RCTBridge* _Nonnull)bridge;
|
|
|
|
@end
|