Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License
"Eclipse Public License v1.0" which accompanies this distribution,
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
Nokia Corporation - initial contribution.
Contributors:
-->
<!DOCTYPE task
PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task xml:lang="en" id="GUID-82B8C95E-F7E7-59C2-A71A-4C882653D555"><title>Continuous Digital Zooming</title><shortdesc>This tutorial describes how to perform continuous digital zooming using the Ecam API. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> <prereq id="GUID-18F6B6F4-909B-58C3-A6B3-014E8B4D5919-GENID-1-10-1-19-1-1-5-1-5-1-6-1-4-1-5-1-3-1"><p>Before you start you should understand the following topics: </p> <ul><li id="GUID-47B2BCC4-347A-5188-9DA4-1AF59A5E0862"><p><xref href="GUID-176913BA-3877-58E2-9E12-3606EE697813.dita">Overview</xref> of the advanced Camera settings functionality. </p> </li> <li id="GUID-A34D2CE7-2C30-5349-85D2-A51023CFBB4B"><p><xref href="GUID-BDB622BF-1CFA-5F1C-81FB-5579C8599689.dita">Tutorial</xref> of the advanced Camera settings functionality. </p> </li> </ul> </prereq> <context id="GUID-D62D84CA-773A-5E47-90A4-2E0FDA70C818"><p>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). </p> <p>For continuous zooming, you need to provide a concrete implementation of <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>MCameraContinuousZoom</apiname></xref>. </p> </context> <steps id="GUID-C66E1385-9555-53A9-BD8B-AC2504F8725F"><step id="GUID-87E8226E-92D7-5C21-AB84-8B69B0E1D5AC"><cmd/><info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraAdvancedSettings::NewL(CCamera&)</apiname></xref> to create a <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraAdvancedSettings</apiname></xref> object. </info> </step> <step id="GUID-390913F8-97B9-5306-8716-96D1A52E1584"><cmd/><info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraAdvancedSettings::GetSupportedContinuousZoomTypeL(TUint&)</apiname></xref> to retrieve supported continuous zoom options for <codeph>CCameraAdvancedSettings</codeph>. </info> </step> <step id="GUID-3F3B7935-D89F-55F0-9AF4-1C38F481C856"><cmd/><info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraAdvancedSettings::CreateContinuousZoomL(MContinuousZoomObserver&,
TContinuousZoomType, CCameraContinuousZoom*&)</apiname></xref> to create a continuous zoom object. </info> </step> <step id="GUID-787CE611-8527-5B9E-AEE7-5434775C40EF"><cmd/><info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraContinuousZoom::GetContinuousZoomSupportInfoL(CCameraAdvancedSettings::TContinuousZoomSupportInfo&)</apiname></xref> to retrieve information about the supported settings related to continuous zoom. </info> </step> <step id="GUID-8DC3F51B-0A0E-5445-AF3B-9F2BA2CC7D99"><cmd/><info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraAdvancedSettings::StartContinuousZoomL(CCameraAdvancedSettings::TContinuousZoomParameters)</apiname></xref> to start the continuous zoom operation. </info> </step> <step id="GUID-86FCBD0A-5208-5220-9620-EF6F8B59210E"><cmd/><info>Call the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraContinuousZoom::ContinuousZoomProgress(CCameraContinuousZoom&,
TInt, TInt)</apiname></xref> function when a new zoom factor has achieved during the current continuous zoom operation. </info> </step> <step id="GUID-404644BF-2C4A-5051-9ABF-928A2800FE23"><cmd/><info>Call the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraAdvancedSettings::GetContinuousZoomId
(TInt aZoomId)</apiname></xref> 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 <codeph>ContinuousZoomProgress()</codeph> or <codeph>ContinuousZoomCompleted()</codeph>) is associated with which continuous zoom object. </info> </step> <step id="GUID-4681BA8B-30A1-5ED6-85C4-3DCA1BE237E0"><cmd/><info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraContinuousZoom::ContinuousZoomCompleted()</apiname></xref> to inform you that the continuous zoom function has either completed successfully or to report an error that has caused the operation to fail. </info> <info>Note: This callback function does not actually stop the continuous zoom. </info> </step> <step id="GUID-B8F65783-F7FB-527D-A053-3E1A5E3321AD"><cmd/><info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraAdvancedSettings::StopContinuousZoom()</apiname></xref> to stop continuous zooming, if the continuous zoom function has not already completed. </info> </step> </steps> <example><title>Example</title> <p>The following example shows you how to perform continuous digital zooming using the Ecam API: </p> <codeblock id="GUID-C91D9A77-001B-5649-9B30-B0F4964C8023" xml:space="preserve">
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);
</codeblock> </example> </taskbody><related-links><link href="GUID-6A7F8298-F3E9-513C-8C1F-D057AC62E5E3.dita"><linktext> Advanced Settings for Focus, Drive Modes,
and Bracket Modes</linktext> </link> </related-links></task>