03b57a7d27
* Use clang-format * Create .clang-format * Update .clang-format * Update .clang-format * Update .clang-format * Only search in cpp dirs * Update clang-format.sh * Update .clang-format * Update .clang-format * Update .clang-format * Format C++ code! * Use version 16 * Update clang-format.sh * Remove Shaders.ts * fix: Lint Swift
33 lines
770 B
Swift
33 lines
770 B
Swift
//
|
|
// CameraView+Preview.swift
|
|
// VisionCamera
|
|
//
|
|
// Created by Marc Rousavy on 20.07.23.
|
|
// Copyright © 2023 mrousavy. All rights reserved.
|
|
//
|
|
|
|
import AVFoundation
|
|
import Foundation
|
|
|
|
extension CameraView {
|
|
public func setupPreviewView() {
|
|
previewView?.removeFromSuperview()
|
|
previewView = NativePreviewView(frame: frame, session: captureSession)
|
|
addSubview(previewView!)
|
|
}
|
|
|
|
func setupFpsGraph() {
|
|
#if DEBUG
|
|
if enableFpsGraph {
|
|
if fpsGraph != nil { return }
|
|
fpsGraph = RCTFPSGraph(frame: CGRect(x: 10, y: 54, width: 75, height: 45), color: .red)
|
|
fpsGraph!.layer.zPosition = 9999.0
|
|
addSubview(fpsGraph!)
|
|
} else {
|
|
fpsGraph?.removeFromSuperview()
|
|
fpsGraph = nil
|
|
}
|
|
#endif
|
|
}
|
|
}
|