react-native-vision-camera/package/ios/Frame Processor/SharedArray.h
Marc Rousavy 773f278df8
fix: Use property accessors on Frame (#2400)
* fix: Use property accessors on `Frame`

* Format

* Use `_Nonnull`

* fix: Assume nonnull

* Use `NS_ASSUME_NONNULL_BEGIN` more

* Format C++
2024-01-16 20:02:03 +01:00

56 lines
1.2 KiB
Objective-C

//
// SharedArray.h
// VisionCamera
//
// Created by Marc Rousavy on 12.01.24.
// Copyright © 2024 mrousavy. All rights reserved.
//
#pragma once
#import "VisionCameraProxy.h"
#import <Foundation/Foundation.h>
#ifdef __cplusplus
#import <jsi/jsi.h>
using namespace facebook;
namespace vision {
// forward-declaration since we cannot import C++ headers here yet.
class TypedArrayBase;
} // namespace vision
#endif
// Needs to be in sync with JSITypedArray.h as the index is used
typedef NS_ENUM(NSInteger, SharedArrayType) {
Int8Array,
Int16Array,
Int32Array,
Uint8Array,
Uint8ClampedArray,
Uint16Array,
Uint32Array,
Float32Array,
Float64Array,
};
NS_ASSUME_NONNULL_BEGIN
@interface SharedArray : NSObject
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithProxy:(VisionCameraProxyHolder*)proxy type:(SharedArrayType)type size:(NSInteger)size;
#ifdef __cplusplus
- (instancetype)initWithRuntime:(jsi::Runtime&)runtime typedArray:(std::shared_ptr<vision::TypedArrayBase>)typedArray;
- (std::shared_ptr<vision::TypedArrayBase>)typedArray;
#endif
@property(nonatomic, readonly, nonnull) uint8_t* data;
@property(nonatomic, readonly) NSInteger count;
@end
NS_ASSUME_NONNULL_END