Continuous Digital Zooming

This tutorial describes how to perform continuous digital zooming using the Ecam API.

Context

For advanced camera settings, the continuous digital zooming API provides a greater control over continuous zoom by allowing you to specify the speed and acceleration of each continuous zoom operation. The minimum speed for zooming is zero and the minimum acceleration is a negative value (which means deceleration).

For continuous zooming, you need to provide a concrete implementation of [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CCamera']]]MCameraContinuousZoom.

Prerequisites

Before you start you should understand the following topics:

  • Overview of the advanced Camera settings functionality.

  • Tutorial of the advanced Camera settings functionality.

Steps

  1. Call [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CCamera']]]CCameraAdvancedSettings::NewL(CCamera&) to create a [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CCamera']]]CCameraAdvancedSettings object.
  2. Call [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CCamera']]]CCameraAdvancedSettings::GetSupportedContinuousZoomTypeL(TUint&) to retrieve supported continuous zoom options for CCameraAdvancedSettings.
  3. Call [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CCamera']]]CCameraAdvancedSettings::CreateContinuousZoomL(MContinuousZoomObserver&, TContinuousZoomType, CCameraContinuousZoom*&) to create a continuous zoom object.
  4. Call [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CCamera']]]CCameraContinuousZoom::GetContinuousZoomSupportInfoL(CCameraAdvancedSettings::TContinuousZoomSupportInfo&) to retrieve information about the supported settings related to continuous zoom.
  5. Call [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CCamera']]]CCameraAdvancedSettings::StartContinuousZoomL(CCameraAdvancedSettings::TContinuousZoomParameters) to start the continuous zoom operation.
  6. Call the [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CCamera']]]CCameraContinuousZoom::ContinuousZoomProgress(CCameraContinuousZoom&, TInt, TInt) function when a new zoom factor has achieved during the current continuous zoom operation.
  7. Call the [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CCamera']]]CCameraAdvancedSettings::GetContinuousZoomId (TInt aZoomId) function when you use more than one continuous zoom operation. This function is used to retrieve a unique ID which you can use to determine the callback function (like ContinuousZoomProgress() or ContinuousZoomCompleted()) is associated with which continuous zoom object.
  8. Call [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CCamera']]]CCameraContinuousZoom::ContinuousZoomCompleted() to inform you that the continuous zoom function has either completed successfully or to report an error that has caused the operation to fail. Note: This callback function does not actually stop the continuous zoom.
  9. Call [[[ERROR: [NOKX000E] Unable to find definition for key reference 'CCamera']]]CCameraAdvancedSettings::StopContinuousZoom() to stop continuous zooming, if the continuous zoom function has not already completed.

Example

The following example shows you how to perform continuous digital zooming using the Ecam API:


CCamera* camera;
MCameraObserver2* observer2;
Camera = CCamera::New2L(*observer2, 0);
CCamera::CCameraAdvancedSettings* settings = CCamera::CCameraAdvancedSettings::NewL(*camera);
 
TUint supportedContinuousZoomType;
settings->GetSupportedContinuousZoomTypeL(supportedContinuousZoomType);
               
CCamera::CCameraAdvancedSettings::TContinuousZoomType continuousZoomType =
                       CCamera::CCameraAdvancedSettings::EContinuousZoomMixed;
 
MContinuousZoomObserver* continuousZoomObserver;     
CCamera::CCameraContinuousZoom* continuousZoom = NULL;
settings->CreateContinuousZoomL(*continuousZoomObserver, continuousZoomType, continuousZoom);
        
CCamera::CCameraAdvancedSettings::TContinuousZoomSupportInfo info;
continuousZoom->GetContinuousZoomSupportInfoL(info);
        
CCamera::CCameraAdvancedSettings::TContinuousZoomParameters param;
param.iContinuousZoomType = continuousZoomType;
param.iContinuousZoomAcceleration = 0;
param.iContinuousZoomSpeed = 1;
param.iContinuousZoomLimit = 5;
param.iZoomDirection = CCamera::CCameraAdvancedSettings::EZoomDirectionWide;
 
continuousZoom->StartContinuousZoomL(param);

Related concepts