Functions
The following functions are available globally.
-
If input position is front-facing camera, returns back-facing camera. If input position is back-facing camera, returns front-facing camera. If input is AVCaptureDevicePositionUnspecified, returns input.
Declaration
Objective-C
AVCaptureDevicePosition SINToggleCaptureDevicePosition(AVCaptureDevicePosition position)
Swift
func SINToggleCaptureDevicePosition(_ position: AVCaptureDevice.Position) -> AVCaptureDevice.Position
Parameters
position
Capture position
Return Value
New capture position
-
Convert a CVPixelBufferRef to an UIImage.
Declaration
Objective-C
UIImage *SINUIImageFromPixelBuffer(CVPixelBufferRef pixelBuffer)
Swift
func SINUIImageFromPixelBuffer(_ pixelBuffer: CVPixelBuffer!) -> UIImage!
Parameters
pixelBuffer
Buffer from which to make an image
Return Value
Prepared image