Viewfinder's Region of Interest

This topic describes how to add area of interest specification and control for viewfinder in the Ecam API.

Before you start:

The CCamera API is extended to allow you to give region of interest (ROI) for viewfinder. The areas of interest are approximated by the rectangle shape. You select a preference order for ROIs. This selection of preference is supported by CCamera . Your selection of preference has higher priority.

The ROIs provides multiple uses for CCamera , they are as follows:

  • Extended focus control

  • Selection of ROI for 3A algorithms computations (autofocus, automatic exposure and automatic white balance).

  1. Call CCameraViewFinder::GetSupportedROIScopeL(TInt& ) to get support and query the number of scope for a viewfinder. For example, If n is the number of ROI scope supported, then scope indices will vary from 0 to –1.

  2. Call CCameraViewFinder::TROIParameters( ) to provide the ROI per scope to the CCamera adaptation. The TROIParameters function is used to allow you to specify a priority with every ROI.

  3. Call CCameraViewFinder::StartROIOperation(const RArray< TROIParameters>&, TInt) to perform the operation depending on the ROI scope, CCamera adaptation adjust the scope priority. When the ROI operation is completed, CCamera adaptation notifies you the completion of the ROI Operation. You have to know the viewfinder and the scope with which this ROI operation is linked. This can be done by issuing a new event KUIdECamEvent2ViewFInderROIReady with iParam as iViewFinderHandle and iParam1 as iROIScopeIndex . Note: You have to prepare a group of the desired region set with high priorities scopes. When you have set the high priorities scopes, you needs to specify the scope based on which the CCamera adaptation uses the ROIs.

  4. Call MDirectViewFInderObserver::ROIChangeReady(CCamera::CCameraV2DirectViewFinder&, Tint, Tint) to extend the callback associated with the two viewfinders in order to provide the ROI scope notifications. The two notification function notifies you that CCamera adaptation starts the ROI operation based on the modified set of ROI parameter.

  5. When the CCamera adaptation changes the ROI scope, call CCameraViewFinder::GetROIParameters (RArray< TROIParameters>&, TInt) to retrieve the ROI according to their higher priorities. You can use these regions for any desired purpose depending on the scope.

  6. Call CCameraViewFinder::StopROIOperation(TInt) to stop ROI operation for the specific scope.