7 Nokia Corporation - initial contribution. |
7 Nokia Corporation - initial contribution. |
8 Contributors: |
8 Contributors: |
9 --> |
9 --> |
10 <!DOCTYPE task |
10 <!DOCTYPE task |
11 PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> |
12 <task xml:lang="en" id="GUID-E9E21C82-13F6-50D4-A271-F9E5F1BD982F"><title>Background Processing for Ecam</title><shortdesc>This topic describes how to capture an image using standalone background processing in Ecam. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> <prereq id="GUID-18F6B6F4-909B-58C3-A6B3-014E8B4D5919-GENID-1-10-1-19-1-1-6-1-5-1-6-1-4-1-12-1-3-1"><p>Before you start you should understand the <xref href="GUID-80EC80E2-E197-50F7-B1FD-720A00AC3B4D.dita">Onboard Camera Overview</xref> topic. </p> </prereq> <context id="GUID-43393C5E-C050-5B00-99CF-4C467DBE1335"><p>The Ecam API has been extended for background processing by having it as a standalone process. In order to use standalone background processing you need to implement the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>MCameraObserver2</apiname></xref>, <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>MPreImageCaptureControlObserver</apiname></xref>, <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>MCaptureImageObserver</apiname></xref> interfaces and use with the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCamera</apiname></xref> API. </p> </context> <steps id="GUID-48762C38-0A88-5EEE-85E2-49DF09ED23A7"><step id="GUID-4F2E1FBC-5593-588D-A4E8-947E58EAADC0"><cmd/><info id="GUID-F6BB2B65-A4FD-53FA-BDD6-37A7D2AB3B54"> To prepare image capturing using the <codeph>CCamera</codeph> API </info> <substeps id="GUID-E491A3EC-80E1-502D-9A7E-F1EB1F69F0A6"><substep id="GUID-A28A04E2-C154-5846-A934-AE175BD4FD91"><cmd>call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraPreImageCaptureControl::GetSupportedProcessingOptionsL(Tint&)</apiname></xref> to get support for processing specified by <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>TECamProcessingTypes</apiname></xref>. </cmd> </substep> <substep id="GUID-BF3B1D7B-D79E-57A9-B5D5-F48938148CB7"><cmd/><info>pass the <codeph>EECamBackgroundProcessing</codeph> option instead of the <codeph>SetImageProcessingOptions</codeph> value within the <codeph>TPrepareImageParameters</codeph> values to the required processing option specified in <codeph>TECamProcessingOptions</codeph> for the background processing. </info> </substep> <substep id="GUID-3EFC3492-D190-5ADE-B293-41BC3775B3C6"><cmd/><info>call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraPreImageCaptureControl::PrepareImageCapture(const |
12 <task id="GUID-E9E21C82-13F6-50D4-A271-F9E5F1BD982F" xml:lang="en"><title>Background |
13 CCameraPreImageCaptureControl:: TPrepareImageParameters&, |
13 Processing for Ecam</title><shortdesc>This topic describes how to capture an image using standalone background |
14 MCaptureImageObserver&)</apiname></xref> to perform setup and allocation of memory for the image capture operation. This implementation creates a new <codeph>CCameraImageCapture()</codeph> object which internally implements the <codeph>MCameraImageCapture()</codeph> interface. </info> <info>If an error occurs while preparing an image, call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraPreImageCaptureControl::PrepareImageComplete(CCameraPreImageCaptureControl*, |
14 processing in Ecam. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> |
15 TInt)</apiname></xref> to pass the <codeph>aErrorCode</codeph> value to <codeph>CCamera</codeph>. </info> </substep> </substeps> </step> <step id="GUID-57389BBB-6434-583D-95F1-E235DACAEA92"><cmd/><info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraImageCapture::CaptureImage()</apiname></xref> to capture an image. This implements <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>MCameraImageCapture()</apiname></xref>. </info> </step> <step id="GUID-DC1848F3-CEF1-58A5-AE9C-9DA6CF602F0D"><cmd/><info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraPostImageCaptureControl::CreateL(CCameraImageCapture*, |
15 <prereq id="GUID-18F6B6F4-909B-58C3-A6B3-014E8B4D5919-GENID-1-12-1-21-1-1-6-1-5-1-5-1-4-1-7-1-3-1"><p>Before you start |
16 TPostCaptureControlId)</apiname></xref> if you wish to capture another image. The <codeph>CCameraPostImageCaptureControl</codeph> object from the previous capture is preserved. This callback function creates a <codeph>CCameraPostImageCaptureControl</codeph> object for every individual image captured. </info> </step> <step id="GUID-27371599-2216-5C53-8730-69E8F9D9F988"><cmd/><info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>MCaptureImageObserver::IndividualImageControlHandle(CCameraImageCapture&, |
16 you should understand the <xref href="GUID-80EC80E2-E197-50F7-B1FD-720A00AC3B4D.dita">Onboard |
17 TPostCaptureControlId)</apiname></xref> to destroy the individual captured image. </info> </step> <step id="GUID-27ADAF59-D386-5693-9106-AC87B6C8C3BA"><cmd/><info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraPostImageCaptureControl::~CCameraPostImageCaptureControl()</apiname></xref> to destroy any captured image objects created by <codeph>CCameraPostImageCaptureControl::CreateL()</codeph>. </info> </step> <step id="GUID-5F31396D-9C68-52F8-8FC3-1C51FC7B74B5"><cmd/><info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraImageCapture::PauseProcessing(TUint)</apiname></xref> to pause any processing options associated with the relevant image capture function. </info> <info>Note: You can call <codeph>PauseProcessing()</codeph> for any processing options used during image capture. </info> </step> <step id="GUID-41D15FB4-E0A8-54FE-90FC-2DF05CA955D0"><cmd/><info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraImageCapture::ResumeProcessingL(TUint)</apiname></xref> to resume any processing options associated with the relevant image capture function. </info> <info>Note: You can call <codeph>ResumeProcessingL()</codeph> for any processing options used during image capture. </info> </step> <step id="GUID-66119341-7FEE-5BCA-A7D8-3471E61B355A"><cmd/><info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCameraPostImageCaptureControl::GetImageStateL(TImageState&)</apiname></xref> to retrieve the image state of the individual image given by the <codeph>CCameraPostImageCaptureControl</codeph> object. </info> </step> </steps> <example><title>Example</title> <p>The following example shows you how to capture an image using standalone background processing in Ecam: </p> <codeblock id="GUID-F4409BA1-A6D9-5855-AB32-FC4672AD136A" xml:space="preserve"> |
17 Camera Overview</xref> topic. </p> </prereq> |
18 |
18 <context id="GUID-43393C5E-C050-5B00-99CF-4C467DBE1335"><p>The Ecam API has |
19 CCamera* camera; |
19 been extended for background processing by having it as a standalone process. |
20 MCameraObserver2* observer2; |
20 In order to use standalone background processing you need to implement the <xref href="GUID-09C6DDB6-A208-3C81-9F54-697D4865D99F.dita"><apiname>MCameraObserver2</apiname></xref>, <xref href="GUID-901FB5EB-70A9-39AA-9052-436E8FC0C0EA.dita"><apiname>MPreImageCaptureControlObserver</apiname></xref>, <xref href="GUID-430C206E-24D7-30BE-98E9-ACD176DDA3A8.dita"><apiname>MCaptureImageObserver</apiname></xref> interfaces and use with the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCamera</apiname></xref> API. </p> </context> |
21 camera = CCamera::New2L(*observer2, 0); |
21 <steps id="GUID-48762C38-0A88-5EEE-85E2-49DF09ED23A7"> |
22 MPreImageCaptureControlObserver* preImageCaptureControlObserver; |
22 <step id="GUID-4F2E1FBC-5593-588D-A4E8-947E58EAADC0"><cmd/> |
23 CCamera::CCameraPreImageCaptureControl* preImgCapture = CCamera::CCameraPreImageCaptureControl::NewL(*camera, preImageCaptureControlObserver)); |
23 <info id="GUID-F6BB2B65-A4FD-53FA-BDD6-37A7D2AB3B54"> To prepare image capturing |
24 TInt supportedProcessingOptions; |
24 using the <codeph>CCamera</codeph> API </info> |
25 preImgCapture->GetSupportedProcessingOptionsL(supportedProcessingOptions); // provides supported image processing options |
25 <substeps id="GUID-E491A3EC-80E1-502D-9A7E-F1EB1F69F0A6"> |
26 CCamera::CCameraPreImageCaptureControl::TPrepareImageParameters prepareImageParameters; |
26 <substep id="GUID-A28A04E2-C154-5846-A934-AE175BD4FD91"><cmd>Call <xref href="GUID-7B13335C-10A9-38D2-AE12-A50ECCF7EA58.dita#GUID-7B13335C-10A9-38D2-AE12-A50ECCF7EA58/GUID-FEADDA78-14DF-38C9-9EEF-DF18955BB39B"><apiname>CCamera::CCameraPreImageCaptureControl::GetSupportedProcessingOptionsL(TUint& |
27 prepareImageParameters::iImageProcessingOptions = EECamBackgroundProcessing; |
27 aECamProcessingOptionsSupported) const</apiname></xref> to get support for processing |
28 ... |
28 specified by <codeph>TECamProcessingTypes</codeph>. </cmd> |
29 ... |
29 </substep> |
30 // Capture image |
30 <substep id="GUID-BF3B1D7B-D79E-57A9-B5D5-F48938148CB7"><cmd/> |
31 ... |
31 <info>Pass the <codeph>EECamBackgroundProcessing</codeph> option instead of |
32 ... |
32 the <codeph>SetImageProcessingOptions</codeph> value within the <codeph>TPrepareImageParameters</codeph> values |
33 TUint processingOptions = EECamBackgroundProcessing; |
33 to the required processing option specified in <codeph>TECamProcessingOptions</codeph> for |
34 imgCapture->PauseProcessing(processingOptions); // Pauses any background processing associated with this image capture |
34 the background processing. </info> |
35 imgCapture->ResumeProcessingL(processingOptions); // Resumes any background processing associated with this image capture |
35 </substep> |
36 |
36 <substep id="GUID-3EFC3492-D190-5ADE-B293-41BC3775B3C6"><cmd/> |
37 // Retrieve the information for any stage of captured image. |
37 <info>Call <xref href="GUID-7906A608-8E79-3144-8595-AAF16BF08A31.dita#GUID-7906A608-8E79-3144-8595-AAF16BF08A31/GUID-EDA3C3EA-E007-36D1-8908-1F13872CA362"><apiname>CCamera::CCameraPreImageCaptureControl::PrepareImageCapture(const |
38 TImageState imgState; |
38 CCameraPreImageCaptureControl::TPrepareImageParameters&, MCaptureImageObserver&)</apiname></xref> to |
39 postImgCapture->GetImageStateL(imgState); // Retrieves the stage of any processing on the current image |
39 perform setup and allocation of memory for the image capture operation. This |
40 |
40 implementation creates a new <codeph>CCameraImageCapture()</codeph> object |
41 |
41 which internally implements the <codeph>MCameraImageCapture()</codeph> interface. </info> |
42 </codeblock> </example> </taskbody><related-links><link href="GUID-DA26D246-D74A-529F-9F81-11B45669103F.dita"><linktext>Capturing Image</linktext> </link> </related-links></task> |
42 <info>If an error occurs while preparing an image, call <xref href="GUID-1FAC4515-39EA-3C89-AE7F-EA6615F8906C.dita#GUID-1FAC4515-39EA-3C89-AE7F-EA6615F8906C/GUID-1BDF7E6E-0542-34CE-A351-252963C88CD9"><apiname>MPreImageCaptureControlObserver::PrepareImageComplete(CCamera::CCameraImageCapture |
|
43 *,TInt)</apiname></xref> to pass the <codeph>aErrorCode</codeph> value to <codeph>CCamera</codeph>. </info> |
|
44 </substep> |
|
45 </substeps> |
|
46 </step> |
|
47 <step id="GUID-57389BBB-6434-583D-95F1-E235DACAEA92"><cmd/> |
|
48 <info>Call <xref href="GUID-4F2BB371-3FE1-3FC5-800B-67B6472FE0E4.dita#GUID-4F2BB371-3FE1-3FC5-800B-67B6472FE0E4/GUID-478F4AF3-56F7-3155-B8BB-5AC6EC8F8673"><apiname>CCamera::CCameraImageCapture::CaptureImage()</apiname></xref> to |
|
49 capture an image. This implements <xref href="GUID-BC75A950-7188-3A8B-BB25-49A119F23E06.dita"><apiname>MCameraImageCapture</apiname></xref>. </info> |
|
50 </step> |
|
51 <step id="GUID-DC1848F3-CEF1-58A5-AE9C-9DA6CF602F0D"><cmd/> |
|
52 <info>Call <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCamera::CCameraPostImageCaptureControl::CreateL(CCameraImageCapture*, |
|
53 TPostCaptureControlId)</apiname></xref> if you wish to capture another |
|
54 image. The <codeph>CCameraPostImageCaptureControl</codeph> object from the |
|
55 previous capture is preserved. This callback function creates a <codeph>CCameraPostImageCaptureControl</codeph> object |
|
56 for every individual image captured. </info> |
|
57 </step> |
|
58 <step id="GUID-27371599-2216-5C53-8730-69E8F9D9F988"><cmd/> |
|
59 <info>Call <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 |
|
60 &,TPostCaptureControlId)</apiname></xref> to destroy the individual captured |
|
61 image. </info> |
|
62 </step> |
|
63 <step id="GUID-27ADAF59-D386-5693-9106-AC87B6C8C3BA"><cmd/> |
|
64 <info>Call <xref href="GUID-C607DA37-D386-3291-A9C5-AD0E302607D3.dita#GUID-C607DA37-D386-3291-A9C5-AD0E302607D3/GUID-36F6EC39-DF31-341E-87D3-D1DCAE192292"><apiname>CCamera::CCameraPostImageCaptureControl::~CCameraPostImageCaptureControl()</apiname></xref> to |
|
65 destroy any captured image objects created by <codeph>CCameraPostImageCaptureControl::CreateL()</codeph>. </info> |
|
66 </step> |
|
67 <step id="GUID-5F31396D-9C68-52F8-8FC3-1C51FC7B74B5"><cmd/> |
|
68 <info>Call <xref href="GUID-4F2BB371-3FE1-3FC5-800B-67B6472FE0E4.dita#GUID-4F2BB371-3FE1-3FC5-800B-67B6472FE0E4/GUID-5C7C7841-E840-3052-B753-4C4D1498AC0F"><apiname>CCamera::CCameraImageCapture::PauseProcessing(TUint)</apiname></xref> to |
|
69 pause any processing options associated with the relevant image capture function. </info> |
|
70 <info>Note: You can call <codeph>PauseProcessing()</codeph> for any processing |
|
71 options used during image capture. </info> |
|
72 </step> |
|
73 <step id="GUID-41D15FB4-E0A8-54FE-90FC-2DF05CA955D0"><cmd/> |
|
74 <info>Call <xref href="GUID-4F2BB371-3FE1-3FC5-800B-67B6472FE0E4.dita#GUID-4F2BB371-3FE1-3FC5-800B-67B6472FE0E4/GUID-D1DB9FF6-0465-3AE4-B3B8-EB5F0EB3F94F"><apiname>CCamera::CCameraImageCapture::ResumeProcessingL(TUint)</apiname></xref> to |
|
75 resume any processing options associated with the relevant image capture function. </info> |
|
76 <info>Note: You can call <codeph>ResumeProcessingL()</codeph> for any processing |
|
77 options used during image capture. </info> |
|
78 </step> |
|
79 <step id="GUID-66119341-7FEE-5BCA-A7D8-3471E61B355A"><cmd/> |
|
80 <info>Call <xref href="GUID-C607DA37-D386-3291-A9C5-AD0E302607D3.dita#GUID-C607DA37-D386-3291-A9C5-AD0E302607D3/GUID-C2C5CCFA-7537-36F9-8063-A8646FC8B6CB"><apiname>CCamera::CCameraPostImageCaptureControl::GetImageStateL(TImageState |
|
81 &)const</apiname></xref> to retrieve the image state of the individual |
|
82 image given by the <codeph>CCameraPostImageCaptureControl</codeph> object. </info> |
|
83 </step> |
|
84 </steps> |
|
85 </taskbody><related-links> |
|
86 <link href="GUID-A1D2C673-3B91-403A-800B-5E1504FB19EE.dita"><linktext>Capturing |
|
87 Still Images</linktext></link> |
|
88 </related-links></task> |