###前提・実現したいこと
AVFoundationを使い、任意の場所をタッチするとそこに露出が合う
カスタムカメラを作成しました。
その露出時間での撮影と、その露出時間から±1の露出時間での撮影を行いたいです。
そこでカメラ画面をタップしたとき(キャプチャする前)の露光時間を取得したいのですが、やり方がわかりません。
宜しくお願いします。
###該当のソースコード
Swift3
1 let maxISO = myDevice.activeFormat.maxISO 2 let minISO = myDevice.activeFormat.minISO 3 let currentISO = (maxISO + minISO)/2 4 do { 5 try myDevice.lockForConfiguration() 6 myDevice.setExposureModeCustomWithDuration(AVCaptureExposureDurationCurrent, iso: curentISO, completionHandler: {(time) -> Void in 7 }) 8 if var _:AVCaptureConnection? = myOutput.connection(withMediaType: AVMediaTypeVideo) { 9 UIImageWriteToSavedPhotosAlbum(self.imageView.image!, self, nil, nil) 10 } 11 myDevice.setExposureModeCustomWithDuration(AVCaptureExposureDurationCurrent, iso: maxISO, completionHandler: {(time) -> Void in 12 }) 13 if var _:AVCaptureConnection? = myOutput.connection(withMediaType: AVMediaTypeVideo) { 14 UIImageWriteToSavedPhotosAlbum(self.imageView.image!, self, nil, nil) 15 } 16 myDevice.setExposureModeCustomWithDuration(AVCaptureExposureDurationCurrent, iso: minISO, completionHandler: {(time) -> Void in 17 }) 18 if var _:AVCaptureConnection? = myOutput.connection(withMediaType: AVMediaTypeVideo) { 19 UIImageWriteToSavedPhotosAlbum(self.imageView.image!, self, nil, nil) 20 } 21 myDevice.unlockForConfiguration() 22 } catch let error { 23 print("lock error: \(error)") 24 } 25 26
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2017/02/20 04:07 編集
退会済みユーザー
2017/02/20 04:06 編集