Created
March 21, 2020 08:40
-
-
Save aminbenarieb/aeb7415ac41ce35cab65a2cc74e83002 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func activeArea(pixelBuffer: CVPixelBuffer) -> CGRect { | |
let width = CVPixelBufferGetWidth(pixelBuffer) | |
let height = CVPixelBufferGetHeight(pixelBuffer) | |
let verticalInset = Double(height) * self.activeInsetProcent | |
let horizontalInset = Double(width) * self.activeInsetProcent | |
return CGRect(x: horizontalInset, | |
y: verticalInset, | |
width: Double(width) - 2*horizontalInset, | |
height: Double(height) - 2*verticalInset) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment