Symbian3/SDK/Source/GUID-55BF8452-F9FF-5CF3-9D74-3BC7F5447551-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1.dita
changeset 0 89d6a7a84779
equal deleted inserted replaced
-1:000000000000 0:89d6a7a84779
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-55BF8452-F9FF-5CF3-9D74-3BC7F5447551-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1" xml:lang="en"><title>CameraExample:
       
    13 Capturing and controlling the images using Camera</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <section id="GUID-737B3B28-3FB0-5A2B-B451-C6B0001F24DE-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1"><title>Description</title> <p>This
       
    15 example is a GUI application and has the standard classes required by any
       
    16 application using UI controls such as an application, a document, an application
       
    17 UI and a view. It provides UI controls such as power on, power off, viewfinder
       
    18 required to capture and control the images. </p> <p> <b>Note:</b> To run the
       
    19 example, you must have a plug-in that supports the Camera implementation.
       
    20 Symbian does not provide any such implementation. </p> <p>The example demonstrates
       
    21 the following key features: </p> <ul>
       
    22 <li id="GUID-091D17C6-4C79-5F4B-ABE1-830F5619EA09-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1-5-1"><p><xref href="GUID-55BF8452-F9FF-5CF3-9D74-3BC7F5447551-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1.dita#GUID-55BF8452-F9FF-5CF3-9D74-3BC7F5447551-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1/GUID-A324BFE2-B946-54A1-A09E-AC5C8E1DDFE1-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1-6">Control settings</xref>  </p> </li>
       
    23 <li id="GUID-2FB651D5-8749-5DD8-8BAF-1A9FFC8F5DB4-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1-5-2"><p><xref href="GUID-55BF8452-F9FF-5CF3-9D74-3BC7F5447551-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1.dita#GUID-55BF8452-F9FF-5CF3-9D74-3BC7F5447551-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1/GUID-7F7A8058-D3AC-5FEA-B82F-81BEF89DB54B-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1-9">Basic settings</xref>  </p> </li>
       
    24 <li id="GUID-14204727-4F8A-5CA0-AC77-4A0504E0256E-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1-5-3"><p><xref href="GUID-55BF8452-F9FF-5CF3-9D74-3BC7F5447551-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1.dita#GUID-55BF8452-F9FF-5CF3-9D74-3BC7F5447551-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1/GUID-D1C48642-0624-57F0-9AE4-D2A409F63870-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1-11">Advanced settings</xref>  </p> </li>
       
    25 </ul> <p id="GUID-A324BFE2-B946-54A1-A09E-AC5C8E1DDFE1-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1-6"><b>Control settings</b> </p> <p>This
       
    26 example demonstrates the following Camera control settings: </p> <ul>
       
    27 <li id="GUID-CD56ECE4-35DA-5637-A24D-7AC62AE44593-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1-8-1"><p> <b>Reserve:</b> Calls
       
    28 the asynchronous <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-3AA43050-7660-32AE-80B5-64A332A45A9E"><apiname>CCamera::Reserve()</apiname></xref> function to initialise
       
    29 and reserve the camera for exclusive use. Calls the <xref href="GUID-F2DC0AB8-A896-3F7A-BBED-848A3F463853.dita#GUID-F2DC0AB8-A896-3F7A-BBED-848A3F463853/GUID-A663DE12-C63B-31C5-9B54-E4DE9C8C538F"><apiname>MCameraObserver::ReserveComplete()</apiname></xref> when
       
    30 initialisation is complete. </p> </li>
       
    31 <li id="GUID-0B9EECF7-A7E4-52B0-AA28-9711508D89F0-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1-8-2"><p> <b>Power on:</b> Calls
       
    32 asynchronous the <xref href="GUID-52DF368F-96BC-3552-9C9E-FB0A291F9AE2.dita#GUID-52DF368F-96BC-3552-9C9E-FB0A291F9AE2/GUID-646B4F4B-7A2F-371B-A05A-2B69B9CE9409"><apiname>CCameraAppUi::PowerOn()</apiname></xref> function to switch
       
    33 on the power of the camera. You must have successfully called the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-3AA43050-7660-32AE-80B5-64A332A45A9E"><apiname>CCamera::Reserve()</apiname></xref> prior
       
    34 to calling this function. Calls the <xref href="GUID-F2DC0AB8-A896-3F7A-BBED-848A3F463853.dita#GUID-F2DC0AB8-A896-3F7A-BBED-848A3F463853/GUID-F6F56654-FA74-3B2B-8098-954E7BF56DBB"><apiname>MCameraObserver::PowerOnComplete()</apiname></xref> when
       
    35 power on is complete. </p> </li>
       
    36 <li id="GUID-19A1B274-D971-53B7-88A4-5B49190F70F0-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1-8-3"><p> <b>Viewfinder:</b> Calls
       
    37 the <xref href="GUID-52DF368F-96BC-3552-9C9E-FB0A291F9AE2.dita#GUID-52DF368F-96BC-3552-9C9E-FB0A291F9AE2/GUID-07462599-A4DC-3F19-88BA-90C2273FC1C2"><apiname>CCameraAppUi::StartViewFinderL()</apiname></xref> function to transfer
       
    38 the viewfinder data to the given portion of the screen using Direct Screen
       
    39 Access. To stop the transfer of the data, the <xref href="GUID-52DF368F-96BC-3552-9C9E-FB0A291F9AE2.dita#GUID-52DF368F-96BC-3552-9C9E-FB0A291F9AE2/GUID-F56E8370-541C-3D53-AD18-D74C915ACC30"><apiname>CCameraAppUi::StopViewFinder()</apiname></xref> function
       
    40 is called. </p> </li>
       
    41 <li id="GUID-C239097A-218E-50EC-B8C9-01D6568F5577-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1-8-4"><p> <b>Capture image:</b> Gets
       
    42 the image size for the index passed by calling the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-4248DD3D-17D9-3EBE-92F9-4FD365AE027E"><apiname>CCamera::EnumerateCaptureSizes()</apiname></xref> function.
       
    43 The image details such as image format and the size index are passed to the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-7BACBBAA-88D8-3DF1-8ED2-3A389A3B223C"><apiname>CCamera::PrepareImageCaptureL()</apiname></xref> function
       
    44 to allocate the memory for the image to be captured. Then, a call to the <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> captures
       
    45 the image. </p> </li>
       
    46 <li id="GUID-4EE3265C-AADA-5D5F-9937-519F87532051-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1-8-5"><p> <b>Capture Video:</b> Gets
       
    47 the video frame size and video frame rate for the index passed by calling
       
    48 the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-C52FB21D-60EE-3202-BB50-ABDF4CDF3DB4"><apiname>CCamera::EnumerateVideoFrameSizes()</apiname></xref> function and the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-F3C6E294-1EF2-3BB4-B1FC-87194DA1D6CA"><apiname>CCamera::EnumerateVideoFrameRates()</apiname></xref> functions
       
    49 respectively. The video details such as frame sizes and frame rate index are
       
    50 passed to the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-12494A9A-D9DE-30F3-B59D-266772507BF2"><apiname>CCamera::PrepareVideoCaptureL ()</apiname></xref> function
       
    51 to allocate the memory for the video to be captured. Then, a call to the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-8743EF65-BE30-3B98-8B35-8BE1A64E93F3"><apiname>CCamera::StartVideoCapture()</apiname></xref> starts
       
    52 capturing the video and a call to the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-E1CC7187-B07C-3584-A10C-24366FB4B203"><apiname>CCamera::StopVideoCapture()</apiname></xref> stops
       
    53 capturing the video. </p> </li>
       
    54 <li id="GUID-35D08B01-12D1-54AE-90EA-447BC072E66E-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1-8-6"><p> <b>Power off:</b> Calls
       
    55 the <xref href="GUID-52DF368F-96BC-3552-9C9E-FB0A291F9AE2.dita#GUID-52DF368F-96BC-3552-9C9E-FB0A291F9AE2/GUID-2C391669-BBD5-3BB4-B487-C437FE012ED3"><apiname>CCameraAppUi::PowerOff()</apiname></xref> function to synchronously
       
    56 switch off the camera power. </p> </li>
       
    57 </ul> <p id="GUID-7F7A8058-D3AC-5FEA-B82F-81BEF89DB54B-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1-9"><b> Basic settings</b> </p> <p>For
       
    58 controlling the brightness and the contrast of the device, calls to the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-F8C3D786-2452-3702-A55D-170EAB5CA27E"><apiname>CCamera::Brightness()</apiname></xref> and
       
    59 the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-119A8C75-FDB7-3DA0-859E-2DE49D8C0CB2"><apiname>CCamera::Contrast()</apiname></xref> functions are made. Increment and
       
    60 decrement factors are separately passed to the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-22722C7A-229A-3BD5-8639-D4A6450B26E1"><apiname>CCamera::SetBrightnessL()</apiname></xref> and
       
    61 the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita#GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4/GUID-8F8DE11C-4350-3010-8B28-A635C82E4214"><apiname>CCamera::SetContrastL()</apiname></xref> functions to increase and decrease
       
    62 the brightness and contrast respectively. Similarly, you can control other
       
    63 features like flash and exposure time of the device. </p> <p id="GUID-D1C48642-0624-57F0-9AE4-D2A409F63870-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-1-11"><b>Advanced
       
    64 settings</b> </p> <p>Advanced settings, such as, capturing a snapshot and
       
    65 presets need to have the corresponding settings object created. This can be
       
    66 done by calling the corresponding advanced setting class's <codeph>NewL()</codeph> function
       
    67 passing in the <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCamera</apiname></xref> object to it. For example, to create
       
    68 a snapshot object, call the <xref href="GUID-7DB06650-199E-3B00-A19A-1B48D671E46E.dita#GUID-7DB06650-199E-3B00-A19A-1B48D671E46E/GUID-F2BC20F6-4E09-3556-8C3D-E7F60329FFB5"><apiname>CCamera::CCameraSnapshot::NewL(*camera)</apiname></xref> function.
       
    69 Use this <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCamera</apiname></xref> object to call any of the functions such
       
    70 as the <xref href="GUID-67DF1203-B840-3C25-8EB5-3F0C8F28A4FF.dita#GUID-67DF1203-B840-3C25-8EB5-3F0C8F28A4FF/GUID-2D0B1BCD-DB21-33F7-A223-9C581E746023"><apiname>CCameraAdvancedSettings::SupportedBracketModes()</apiname></xref>,
       
    71 the <xref href="GUID-9749B0DF-B887-3798-9185-481DF8E2F7C2.dita#GUID-9749B0DF-B887-3798-9185-481DF8E2F7C2/GUID-DB5EF834-999A-3726-AAB8-AC3925D6B7F2"><apiname>CCameraSnapshot::StartSnapshot()</apiname></xref>, the <xref href="GUID-02976C21-8B30-3E1C-ADA5-5205AF46408E.dita#GUID-02976C21-8B30-3E1C-ADA5-5205AF46408E/GUID-EB64375C-FB2D-3078-8115-85386BA8B4C5"><apiname>CCameraDirectViewFinder::ResumeViewFinderDirectL()</apiname></xref> and
       
    72 the <xref href="GUID-BC0F4399-4DA7-3977-AD17-8415AEBA7317.dita#GUID-BC0F4399-4DA7-3977-AD17-8415AEBA7317/GUID-DB4C212F-FDFE-318F-A740-87FCE427BE09"><apiname>CCameraHistogram::PrepareHistogramL()</apiname></xref> to set the advanced
       
    73 features. </p> </section>
       
    74 <section><title>Download</title> <p>Click on the following link to download
       
    75 the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-b491ac90-54d1-4183-8004-70ae0725468d.zip" scope="external">CameraExample.zip file</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-b491ac90-54d1-4183-8004-70ae0725468d.html" scope="peer">browse </xref> to view the example code. </p> </section>
       
    76 <section><title>Class summary</title><p> <xref href="GUID-021C509B-C821-3401-B2F4-DE7F52BB16D4.dita"><apiname>CCamera </apiname></xref> <xref href="GUID-67DF1203-B840-3C25-8EB5-3F0C8F28A4FF.dita"><apiname>CCameraAdvancedSettings </apiname></xref>  <xref href="GUID-02976C21-8B30-3E1C-ADA5-5205AF46408E.dita"><apiname>CCameraDirectViewFinder </apiname></xref>  <xref href="GUID-9749B0DF-B887-3798-9185-481DF8E2F7C2.dita"><apiname>CCameraSnapshot </apiname></xref> <xref href="GUID-BC0F4399-4DA7-3977-AD17-8415AEBA7317.dita"><apiname>CCameraHistogram </apiname></xref>  <xref href="GUID-75F14618-727C-340C-B34A-ECEEA5F612F9.dita"><apiname>CCameraOverlay </apiname></xref><xref href="GUID-2D94F0AD-10D4-3C3E-B445-3728718C8765.dita"><apiname>CCameraImageProcessing </apiname></xref>  <xref href="GUID-196072A3-9152-3E61-A09D-1BD071D1E908.dita"><apiname>CCameraPresets </apiname></xref><xref href="GUID-09C6DDB6-A208-3C81-9F54-697D4865D99F.dita"><apiname>MCameraObserver2 </apiname></xref>  </p></section>
       
    77 <section id="GUID-4B0B8B67-DCF1-5551-9EFF-7D021D0FD9CE-GENID-1-6-1-17-1-1-5-1-5-1-4-1-3-1-2-4"><title>Build</title> <p>The <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">Symbian build process</xref> describes
       
    78 how to build an application. </p> <p>The CameraExample builds an executable
       
    79 called <filepath>cameraexample.exe</filepath> in the standard location (<filepath>\epoc32\release\winscw\</filepath> <i>&lt;build_variant&gt;</i> for
       
    80 CodeWarrior). Either launch the executable itself, or launch the emulator
       
    81 and then select the icon CameraExample from the Emulator's extras bar. </p> </section>
       
    82 </conbody></concept>