2021-02-19 08:28:05 -07:00
|
|
|
//
|
2023-09-01 04:58:32 -06:00
|
|
|
// CameraView+Focus.swift
|
2023-10-13 10:33:20 -06:00
|
|
|
// VisionCamera
|
2021-02-19 08:28:05 -07:00
|
|
|
//
|
2023-10-13 10:33:20 -06:00
|
|
|
// Created by Marc Rousavy on 12.10.23.
|
|
|
|
// Copyright © 2023 mrousavy. All rights reserved.
|
2021-02-19 08:28:05 -07:00
|
|
|
//
|
|
|
|
|
2023-10-13 10:33:20 -06:00
|
|
|
import AVFoundation
|
2021-02-19 08:28:05 -07:00
|
|
|
import Foundation
|
|
|
|
|
|
|
|
extension CameraView {
|
|
|
|
func focus(point: CGPoint, promise: Promise) {
|
|
|
|
withPromise(promise) {
|
2023-11-27 06:43:56 -07:00
|
|
|
let normalized = previewView.captureDevicePointConverted(fromLayerPoint: point)
|
|
|
|
try cameraSession.focus(point: normalized)
|
2023-10-13 10:33:20 -06:00
|
|
|
return nil
|
2023-10-06 06:30:12 -06:00
|
|
|
}
|
|
|
|
}
|
2021-02-19 08:28:05 -07:00
|
|
|
}
|