Created
July 22, 2017 12:08
-
-
Save NikhilManapure/aaaa2aa30b21bc2d2e8dc3e23e2126f9 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
| extension AVCaptureDevice { | |
| var hdrMode: HDRMode { | |
| set(newValue){ | |
| switch newValue { | |
| case .on: | |
| automaticallyAdjustsVideoHDREnabled = false | |
| isVideoHDREnabled = true | |
| case .off: | |
| automaticallyAdjustsVideoHDREnabled = false | |
| isVideoHDREnabled = false | |
| case .auto: | |
| automaticallyAdjustsVideoHDREnabled = true | |
| } | |
| } | |
| get { | |
| if automaticallyAdjustsVideoHDREnabled { | |
| return .auto | |
| } else { | |
| if isVideoHDREnabled { | |
| return .on | |
| } else { | |
| return .off | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment