How do you calculate the focusPointOfInterest (a CGPoint value between 0,0 and 1,1) for an given AVCaptureDevice?
I've been following the code samples from the latest WWDC but I really don't understand how to calculation is being made. Also, my application is sitting in landscape vs. portrait (as in the sample) ... so in addition to not understanding how things are being calculated, I'm not sure what adjustments I need to make in order to account for landscape orientation.
Any help would be appreciated.
Thanks - wg
If you have an AVCaptureVideoPreviewLayer
, you can use captureDevicePointOfInterestForPoint
in order to convert the CGPoint
you get with a tap gesture.
That way you just don't have to worry about orientation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With