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 id="GUID-36BD6059-6547-5754-8BE0-F8051A838C14" xml:lang="en"><title>Using
Time-Nudge-Capture Drive Mode </title><shortdesc>This topic describes how to capture an image using Time-Nudge-Capture
drive mode in the Ecam API. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
<prereq id="GUID-B36A21C3-041E-5DBE-A019-705F64A9DCFA"><p>Before you start
you should understand the following topics: </p> <ul>
<li><p><xref href="GUID-A1D2C673-3B91-403A-800B-5E1504FB19EE.dita">Capturing Still
Images</xref></p></li>
<li id="GUID-C875638C-B10A-511A-B7DF-8BB6ED543B0E"><p><xref href="GUID-176913BA-3877-58E2-9E12-3606EE697813.dita">Advanced
Camera Settings Overview</xref>. </p> </li>
</ul> </prereq>
<context id="GUID-C666890D-A6ED-4ABB-982A-CEC3E9881652"><p>The <xref href="GUID-E31AEB11-B7A0-3637-BB31-866306F78118.dita#GUID-E31AEB11-B7A0-3637-BB31-866306F78118/GUID-552E8197-2AD8-377D-A15A-7EB14C836C86"><apiname>CCamera::CCameraAdvancedSettings::EDriveModeTimeNudgeCapture</apiname></xref> mode
allows you to specify the amount of images to be captured both before and
after the capture button key press. The numbers of pre- or post-capture images
to be captured are set by the <xref href="GUID-7B13335C-10A9-38D2-AE12-A50ECCF7EA58.dita#GUID-7B13335C-10A9-38D2-AE12-A50ECCF7EA58/GUID-AED9AF83-72F6-3A5A-8693-81690A58789E"><apiname>CCamera::CCameraPreImageCaptureControl::TDriveModeDependentAttributes</apiname></xref> values,
with the total number of images being calculated as follows: </p> <p> <codeph>Total
number of captured images = iParam1 + 1 + iParam2 </codeph> where <codeph>iParam1</codeph> and <codeph>iParam2</codeph> represent
pre and post capture images respectively, and 1 represents the present image. </p> </context>
<steps id="GUID-C600E75D-1C96-5D04-8F72-9EC4DCD406C6">
<step id="GUID-10359A66-1222-5C8A-87E6-7E7E1CAD8847"><cmd/>
<info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-C5A323D2-322D-3784-9546-A066B50C4DE1"><apiname>CCamera::New2L(MCameraObserver2 &,TInt,TInt)</apiname></xref> to
create an instance of <codeph>CCamera</codeph>. </info>
</step>
<step id="GUID-7AAE2DB9-0A64-55E6-814F-B6204F19BCF1"><cmd/>
<info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-7B13335C-10A9-38D2-AE12-A50ECCF7EA58"><apiname>CCamera::CCameraPreImageCaptureControl</apiname></xref> to create
an image capture object. </info>
</step>
<step id="GUID-7686E078-40F5-56E2-B35F-09CC248994AD"><cmd/>
<info>Call <xref href="GUID-7B13335C-10A9-38D2-AE12-A50ECCF7EA58.dita#GUID-7B13335C-10A9-38D2-AE12-A50ECCF7EA58/GUID-784D7379-183B-3A3E-81A4-CD78DE68F78A"><apiname>CCamera::CCameraPreImageCaptureControl::PrepareImageCapture(const
TPrepareImageParameters &,MCaptureImageObserver &)</apiname></xref> to prepare
for capturing the image. <codeph>TPrepareImageParameter</codeph> uses <codeph>TDriveModeDependentAttributes</codeph> to
set the number of images before and after the camera capture key press event.
The <codeph>iDriveMode</codeph> value in <codeph>TPrepareImageParameter</codeph> should
be replaced into the <codeph>EDriveModeTimeNudgeCapture</codeph> value, to
support the time-nudge-capture drive mode. </info>
<info>If an <codeph>aErrorCode</codeph> occurs while preparing an image, you
have to call <codeph>CCamera::PrepareImageComplete(CCamera::CCameraImageCapture*,
TInt)</codeph>. </info>
<info>Note: The <codeph>PrepareImageComplete()</codeph> callback is deferred
until the implementation is ready with the pre-image data saved in the buffer
so that you can press the capture key at any time. Meanwhile the implementation
continues saving the latest pre-capture images until the <codeph>CaptureImage()</codeph> function
is called. </info>
</step>
<step id="GUID-016FF403-E087-53CA-9EC7-223496A7AE60"><cmd/>
<info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-0536FECC-1BD8-3726-8BBE-B1231739F23E"><apiname>CCamera::CaptureImage()</apiname></xref> to capture an image. </info>
<info>Note: You can call the <codeph>CaptureImage()</codeph> function to capture
the current image exposed to the sensor plus the required number of post-image
capture images. </info>
</step>
<step id="GUID-912DC8A8-51F5-5912-9474-1CE28C51715D"><cmd/>
<info>Call the <xref href="GUID-FB8D88AD-5F05-363B-94EF-70E3E2E7F386.dita#GUID-FB8D88AD-5F05-363B-94EF-70E3E2E7F386/GUID-8EF6EC5F-91F4-3E9C-BF63-B4849974AEB1"><apiname>MCaptureImageObserver::IndividualImageControlHandle(CCamera::CCameraImageCapture
&,TPostCaptureControlId)</apiname></xref> function for each captured image to
pass the individual id of each image to the client. </info>
</step>
<step id="GUID-38DBA9EA-0267-5C31-8D82-E81111636198"><cmd/>
<info>Call <xref href="GUID-6DA94579-7A7C-3790-B36A-1D76A84237B9.dita#GUID-6DA94579-7A7C-3790-B36A-1D76A84237B9/GUID-F5C9E1C6-FBA7-3278-8753-BF217CA7D788"><apiname>MCaptureImageObserver::ImageCaptureComplete(CCamera::CCameraImageCapture
&,TInt)</apiname></xref> and <xref href="GUID-09C6DDB6-A208-3C81-9F54-697D4865D99F.dita#GUID-09C6DDB6-A208-3C81-9F54-697D4865D99F/GUID-92A1BB39-F8AC-388D-93FC-32CEC1EB839F"><apiname>MCameraObserver2::HandleEvent(const TECAMEvent
&)</apiname></xref> to notify the client that the current capture operation has
finished. </info>
<info>Note: This must only occur once the implementation has saved another
set of pre-image capture images. This is so that the implementation is ready
to receive further <codeph>CaptureImage()</codeph> calls. </info>
</step>
<step id="GUID-94BF1548-C4B1-5BBE-AB08-E0A7521BF0CF"><cmd/>
<info>Call <xref href="GUID-4B9D0D47-B1E4-3A0C-9AB0-C27E7BAFB99C.dita#GUID-4B9D0D47-B1E4-3A0C-9AB0-C27E7BAFB99C/GUID-1E0AAFB9-61BB-3629-B9B8-E5C1190093EB"><apiname>CCamera::CCameraPostImageCaptureControl::CCameraPostImageCaptureControl(CCamera::CCameraImageCapture
*,TPostCaptureControlId)</apiname></xref> to control the post image capture after
capturing the desired image. </info>
</step>
<step id="GUID-CCD9A5F2-0447-5154-ACC5-950CC0EC2512"><cmd/>
<info>Call the <xref href="GUID-09C6DDB6-A208-3C81-9F54-697D4865D99F.dita#GUID-09C6DDB6-A208-3C81-9F54-697D4865D99F/GUID-92A1BB39-F8AC-388D-93FC-32CEC1EB839F"><apiname>MCameraObserver2::HandleEvent(const TECAMEvent &)</apiname></xref> function
when you have deleted the current <codeph>CCameraImageCapture</codeph> object. </info>
<info>Note: In this drive mode, only one instance of <codeph>CCameraImageCapture</codeph> can
be created at any one time, that is, <codeph>PrepareImageCapture()</codeph> can
only be called once. In order to successfully call <codeph>PrepareImageCapture()</codeph> again
and create a new <codeph>CCameraImageCapture</codeph> object, clients must
first destroy the previous one. Therefore, the implementation should only
issue this callback once the client has deleted the object. </info>
</step>
</steps>
</taskbody><related-links>
<link href="GUID-BDB622BF-1CFA-5F1C-81FB-5579C8599689.dita"><linktext>Camera Library</linktext>
</link>
</related-links></task>