Contents

exposureRectOfInterest

The device’s current exposure rectangle of interest, if it has one.

Declaration

var exposureRectOfInterest: CGRect { get set }

Discussion

The value of this property is a CGRect determining the device’s exposure rectangle of interest. Use this as an alternative to setting exposurePointOfInterest, as it allows you to specify both a location and size. For example, a value of CGRectMake(0, 0, 1, 1) tells the device to use the entire field of view when determining the exposure, while CGRectMake(0, 0, 0.25, 0.25) indicates the top left sixteenth, and CGRectMake(0.75, 0.75, 0.25, 0.25) indicates the bottom right sixteenth. Setting exposureRectOfInterest throws an NSInvalidArgumentException if isExposureRectOfInterestSupported returns false. Setting exposureRectOfInterest throws an NSInvalidArgumentException if your provided rectangle’s size is smaller than the minExposureRectOfInterestSize. Setting exposureRectOfInterest throws an NSGenericException if you call it without first obtaining exclusive access to the device using lockForConfiguration(). Setting exposureRectOfInterest updates the device’s exposurePointOfInterest to the center of your provided rectangle of interest. If you later set the device’s exposurePointOfInterest, the exposureRectOfInterest resets to the default sized rectangle of interest for the new exposure point of interest. If you change your activeFormat, the point of interest and rectangle of interest both revert to their default values. You can observe automatic changes to the device’s exposureRectOfInterest by key-value observing this property.

See Also

Setting an exposure rectangle of interest