camera_set_exposure_regions()

Updated: April 19, 2023

Configure the auto exposure regions on the camera

Synopsis:

#include <camera/camera_3a.h>
camera_error_t camera_set_exposure_regions(camera_handle_t handle,
                                           int numregions,
                                           camera_region_t *regions)

Arguments:

handle
The handle returned by a call to the camera_open() function.
numregions
The number of regions to apply, which is the number of elements in the regions array.
regions
A pointer to an array of exposure regions to apply. The region co-ordinates are interpreted relative to a viewfinder buffer with (0, 0) representing the top-left corner of the frame, and (width-1, height-1) representing the bottom-right corner. If CAMERA_IMGPROP_ROTATION is applied to the viewfinder, then the co-ordinate frame of reference is also rotated accordingly.

Library:

libcamapi

Description:

Call this function only if the CAMERA_FEATURE_REGIONEXPOSURE feature is available. You can call camera_has_feature() to determine if this feature is available.

When exposure regions are defined, the auto exposure algorithm will give exposure priority to objects in the defined areas of the scene. The maximum number of exposure regions that you can configure is returned by the numsupported argument of the camera_get_exposure_regions() function.

After setting the regions, you must call camera_set_exposure_mode() to commit the changes.

Returns:

CAMERA_EOK when the function successfully completes, otherwise another camera_error_t value that provides the reason that the call failed.