記錄學習內容。看網路上大大們的文章和影片,做些筆記。
來確認AVFoundation相機的功能 ,還沒實作:
之前好像是叫flashMode:
flashMode
現在應該是叫torchMode :
torchMode
裡面有個項目是torchLevel , 可以調整手電筒亮度:
The value of this property is a floating-point number whose value is in the range 0.0 to 1.0.
A torch level of 0.0 indicates that the torch is off.
A torch level of 1.0 represents the theoretical maximum value
AVCaptureDevice.TorchMode ,閃光有三種模式可以設定:
有一些檢查 有沒有手電筒 或是 閃光模式 的方法 ,
用來防止 如果手機沒有手電筒 ,程式會crash之類的 。
A value that controls the cropping (裁減)and enlargement(放大) of images captured by the device.
For example, a value of 2.0 doubles the size of an image’s subject
How to change size setting of video capturing by AVFoundation
AVCaptureSessionPreset
像是有
AVCaptureSessionPresetiFrame1280x720
Specifies capture settings to achieve 1280 x 720 quality iFrame H.264 video at about 40 Mbits/sec with AAC audio.
這個好像也是類似 , 還不懂,實作後在觀察:
inputPriority
不懂這句話意思:
Specifies that the capture session does not control audio and video output settings.
focusMode
AVCaptureDevice.FocusMode
UIViewController 版本的camera :
IlijaMihajlovic/AVFoundation-Camera-App
SwiftUI版本的camera :
brettfazio/CameraView
相機畫面跟這個有關:
UIViewRepresentable
如果要在SwiftUI 使用UIKit的東西 ,使用UIViewRepresentable:
A wrapper for a UIKit view that you use to integrate that view into your SwiftUI view hierarchy.