Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/iclmainexample_8cpp-source.html
Addition of the PDK content and example code for Documentation_content according to Feature bug 1607 and bug 1608
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>TB10.1 Example Applications: examples/Multimedia/ICL/ICLExample/iclmainexample.cpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.3 -->
<h1>examples/Multimedia/ICL/ICLExample/iclmainexample.cpp</h1><a href="iclmainexample_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// iclmainexample.cpp</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).</span>
<a name="l00004"></a>00004 <span class="comment">// All rights reserved.</span>
<a name="l00005"></a>00005 <span class="comment">// This component and the accompanying materials are made available</span>
<a name="l00006"></a>00006 <span class="comment">// under the terms of "Eclipse Public License v1.0"</span>
<a name="l00007"></a>00007 <span class="comment">// which accompanies this distribution, and is available</span>
<a name="l00008"></a>00008 <span class="comment">// at the URL "http://www.eclipse.org/legal/epl-v10.html".</span>
<a name="l00009"></a>00009 <span class="comment">//</span>
<a name="l00010"></a>00010 <span class="comment">// Initial Contributors:</span>
<a name="l00011"></a>00011 <span class="comment">// Nokia Corporation - initial contribution.</span>
<a name="l00012"></a>00012 <span class="comment">//</span>
<a name="l00013"></a>00013 <span class="comment">// Contributors:</span>
<a name="l00014"></a>00014 <span class="comment">//</span>
<a name="l00015"></a>00015 <span class="comment">// Description:</span>
<a name="l00016"></a>00016 <span class="comment">// </span>
<a name="l00017"></a>00017 <span class="comment">//</span>
<a name="l00018"></a>00018
<a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="iclexample_8h.html">iclexample.h</a>"</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include <f32file.h></span>
<a name="l00027"></a>00027
<a name="l00032"></a><a class="code" href="class_c_active_listener.html#ba7c784e9f4a6fdc1e4df64ad959e5b6">00032</a> <a class="code" href="class_c_active_listener.html">CActiveListener</a>* <a class="code" href="class_c_active_listener.html#ba7c784e9f4a6fdc1e4df64ad959e5b6">CActiveListener::NewLC</a>()
<a name="l00033"></a>00033 {
<a name="l00034"></a>00034 <a class="code" href="class_c_active_listener.html">CActiveListener</a>* <span class="keyword">self</span> = <span class="keyword">new</span>(ELeave) <a class="code" href="class_c_active_listener.html">CActiveListener</a>();
<a name="l00035"></a>00035 CleanupStack::PushL(<span class="keyword">self</span>);
<a name="l00036"></a>00036 <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00037"></a>00037 }
<a name="l00038"></a>00038
<a name="l00042"></a>00042 CActiveListener::CActiveListener() : CActive(EPriorityLow)
<a name="l00043"></a>00043 {
<a name="l00044"></a>00044 CActiveScheduler::Add(<span class="keyword">this</span>);
<a name="l00045"></a>00045 }
<a name="l00046"></a>00046
<a name="l00050"></a><a class="code" href="class_c_active_listener.html#65d4324ccbf6e0881cec87107cb067af">00050</a> <a class="code" href="class_c_active_listener.html#65d4324ccbf6e0881cec87107cb067af">CActiveListener::~CActiveListener</a>()
<a name="l00051"></a>00051 {
<a name="l00052"></a>00052 }
<a name="l00053"></a>00053
<a name="l00058"></a>00058 <span class="keywordtype">void</span> CActiveListener::RunL()
<a name="l00059"></a>00059 {
<a name="l00060"></a>00060 CActiveScheduler::Stop();
<a name="l00061"></a>00061 }
<a name="l00062"></a>00062
<a name="l00067"></a>00067 <span class="keywordtype">void</span> CActiveListener::DoCancel()
<a name="l00068"></a>00068 {
<a name="l00069"></a>00069 }
<a name="l00070"></a>00070
<a name="l00074"></a><a class="code" href="class_c_active_listener.html#5172079a442a39dc9e411cb7ff4b9bad">00074</a> <span class="keywordtype">void</span> <a class="code" href="class_c_active_listener.html#5172079a442a39dc9e411cb7ff4b9bad">CActiveListener::Initialize</a>()
<a name="l00075"></a>00075 {
<a name="l00076"></a>00076 iStatus = KRequestPending;
<a name="l00077"></a>00077 SetActive();
<a name="l00078"></a>00078 }
<a name="l00079"></a>00079
<a name="l00084"></a><a class="code" href="class_c_active_listener.html#6258b3077c159f550fcffc95df8c7c94">00084</a> TBool <a class="code" href="class_c_active_listener.html#6258b3077c159f550fcffc95df8c7c94">CActiveListener::IsRequestCancelled</a>()
<a name="l00085"></a>00085 {
<a name="l00086"></a>00086 <span class="keywordflow">return</span> (iStatus == KErrCancel);
<a name="l00087"></a>00087 }
<a name="l00088"></a>00088
<a name="l00089"></a>00089
<a name="l00090"></a>00090
<a name="l00096"></a><a class="code" href="class_c_icl_example.html#6f3bc3fc2ea6e0f5424c98db5a200750">00096</a> <a class="code" href="class_c_icl_example.html">CIclExample</a>* <a class="code" href="class_c_icl_example.html#6f3bc3fc2ea6e0f5424c98db5a200750">CIclExample::NewLC</a>()
<a name="l00097"></a>00097 {
<a name="l00098"></a>00098 <a class="code" href="class_c_icl_example.html">CIclExample</a>* <span class="keyword">self</span> = <span class="keyword">new</span>(ELeave) <a class="code" href="class_c_icl_example.html">CIclExample</a>();
<a name="l00099"></a>00099 CleanupStack::PushL(<span class="keyword">self</span>);
<a name="l00100"></a>00100 <span class="keyword">self</span>->ConstructL();
<a name="l00101"></a>00101 <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00102"></a>00102 }
<a name="l00103"></a>00103
<a name="l00107"></a>00107 CIclExample::CIclExample()
<a name="l00108"></a>00108 {
<a name="l00109"></a>00109 }
<a name="l00110"></a>00110
<a name="l00111"></a>00111 <span class="keywordtype">void</span> CIclExample::ConstructL()
<a name="l00112"></a>00112 {
<a name="l00113"></a>00113 User::LeaveIfError(iFs.Connect());
<a name="l00114"></a>00114 User::LeaveIfError(RFbsSession::Connect());
<a name="l00115"></a>00115 }
<a name="l00116"></a>00116
<a name="l00120"></a><a class="code" href="class_c_icl_example.html#749d8fa9e3e740dda9c1ea2debb740ab">00120</a> <a class="code" href="class_c_icl_example.html#749d8fa9e3e740dda9c1ea2debb740ab">CIclExample::~CIclExample</a>()
<a name="l00121"></a>00121 {
<a name="l00122"></a>00122 RFbsSession::Disconnect();
<a name="l00123"></a>00123 iFs.Close();
<a name="l00124"></a>00124
<a name="l00125"></a>00125 <span class="comment">// Close REComSession</span>
<a name="l00126"></a>00126 REComSession::FinalClose();
<a name="l00127"></a>00127 }
<a name="l00128"></a>00128
<a name="l00129"></a>00129
<a name="l00136"></a>00136 TPtr8 CIclExample::LoadImageIntoMemoryLC(<span class="keyword">const</span> TDesC& aFileName)
<a name="l00137"></a>00137 {
<a name="l00138"></a>00138 RFile file;
<a name="l00139"></a>00139 TInt fileSize = 0;
<a name="l00140"></a>00140
<a name="l00141"></a>00141 <span class="comment">// Open the file for decoding.</span>
<a name="l00142"></a>00142 User::LeaveIfError(file.Open(iFs, aFileName, EFileRead));
<a name="l00143"></a>00143 CleanupClosePushL(file);
<a name="l00144"></a>00144 User::LeaveIfError(file.Size(fileSize));
<a name="l00145"></a>00145
<a name="l00146"></a>00146 HBufC8* imageInMemory = HBufC8::NewMaxL(fileSize);
<a name="l00147"></a>00147 TPtr8 imageInMemoryPtr = imageInMemory->Des();
<a name="l00148"></a>00148
<a name="l00149"></a>00149 <span class="comment">// We must reorder the cleanupstack.</span>
<a name="l00150"></a>00150 CleanupStack::Pop(); <span class="comment">// file</span>
<a name="l00151"></a>00151 CleanupStack::PushL(imageInMemory); <span class="comment">// imageInMemory</span>
<a name="l00152"></a>00152 CleanupClosePushL(file);
<a name="l00153"></a>00153
<a name="l00154"></a>00154 <span class="keywordflow">if</span> (file.SubSessionHandle())
<a name="l00155"></a>00155 {
<a name="l00156"></a>00156 User::LeaveIfError(file.Read(imageInMemoryPtr));
<a name="l00157"></a>00157 }
<a name="l00158"></a>00158
<a name="l00159"></a>00159 CleanupStack::PopAndDestroy(); <span class="comment">// file</span>
<a name="l00160"></a>00160 <span class="keywordflow">return</span> imageInMemoryPtr;
<a name="l00161"></a>00161 }
<a name="l00162"></a>00162
<a name="l00163"></a>00163
<a name="l00168"></a><a class="code" href="class_c_icl_example.html#6cb9b9dbd3a9e04e6ad4f144e6e2a8d9">00168</a> <a class="code" href="class_c_active_listener.html">CActiveListener</a>* <a class="code" href="class_c_icl_example.html#6cb9b9dbd3a9e04e6ad4f144e6e2a8d9">CIclExample::CreateAndInitializeActiveListenerLC</a>()
<a name="l00169"></a>00169 {
<a name="l00170"></a>00170 <span class="comment">// Create an active Listener and push it on the cleanup stack</span>
<a name="l00171"></a>00171 <a class="code" href="class_c_active_listener.html">CActiveListener</a>* activeListener = <a class="code" href="class_c_active_listener.html#ba7c784e9f4a6fdc1e4df64ad959e5b6">CActiveListener::NewLC</a>();
<a name="l00172"></a>00172 activeListener-><a class="code" href="class_c_active_listener.html#5172079a442a39dc9e411cb7ff4b9bad">Initialize</a>();
<a name="l00173"></a>00173 <span class="keywordflow">return</span> activeListener;
<a name="l00174"></a>00174 }
<a name="l00175"></a>00175
<a name="l00176"></a>00176
<a name="l00177"></a><a class="code" href="iclmainexample_8cpp.html#689e0bf9aa924a1d7dc108665d44736c">00177</a> LOCAL_C <span class="keywordtype">void</span> <a class="code" href="circularbuffer_8cpp.html#5fb473d4ee18739183215b04dcad6e12">MainL</a>()
<a name="l00178"></a>00178 {
<a name="l00179"></a>00179 <span class="comment">// Create a CConsoleBase to define console interface</span>
<a name="l00180"></a>00180 CConsoleBase* gConsole = Console::NewL(KTitle, TSize(KConsFullScreen, KConsFullScreen));
<a name="l00181"></a>00181 CleanupStack::PushL(gConsole);
<a name="l00182"></a>00182
<a name="l00183"></a>00183 <span class="comment">// Create an active scheduler to handle asychronous calls</span>
<a name="l00184"></a>00184 CActiveScheduler* scheduler = <span class="keyword">new</span>(ELeave) CActiveScheduler();
<a name="l00185"></a>00185 CleanupStack::PushL(scheduler);
<a name="l00186"></a>00186 CActiveScheduler::Install(scheduler);
<a name="l00187"></a>00187
<a name="l00188"></a>00188 <a class="code" href="class_c_icl_example.html">CIclExample</a>* app = <a class="code" href="class_c_icl_example.html#6f3bc3fc2ea6e0f5424c98db5a200750">CIclExample::NewLC</a>();
<a name="l00189"></a>00189 app-><a class="code" href="class_c_icl_example.html#8a9d3b1a70c5df0fc5760c36ab9d87c5">SetConsole</a>(gConsole);
<a name="l00190"></a>00190
<a name="l00191"></a>00191 gConsole->Printf(KWelcomeMessage);
<a name="l00192"></a>00192 gConsole->Printf(KPressAKeyMsg);
<a name="l00193"></a>00193 gConsole->Getch();
<a name="l00194"></a>00194
<a name="l00195"></a>00195 <span class="comment">//Panorama Stitching</span>
<a name="l00196"></a>00196 gConsole->Printf(KPanoramaStitching);
<a name="l00197"></a>00197
<a name="l00198"></a>00198 <span class="comment">//Stitch images already captured to form a panorama</span>
<a name="l00199"></a>00199 _LIT(KPath,<span class="stringliteral">"z:\\resource\\plugins\\"</span>);
<a name="l00200"></a>00200 _LIT(KFile,<span class="stringliteral">"panoramaplugin.rsc"</span>);
<a name="l00201"></a>00201
<a name="l00202"></a>00202 <span class="comment">/*</span>
<a name="l00203"></a>00203 <span class="comment"> Check for the availability of the panorama plugin. If it is not available, skip the code that uses it.</span>
<a name="l00204"></a>00204 <span class="comment"> */</span>
<a name="l00205"></a>00205 RFs fsSession;<span class="comment">// Connect session</span>
<a name="l00206"></a>00206 User::LeaveIfError(fsSession.Connect());
<a name="l00207"></a>00207
<a name="l00208"></a>00208 TFindFile file(fsSession);
<a name="l00209"></a>00209 TInt panoramaPluginSupport;
<a name="l00210"></a>00210 panoramaPluginSupport = file.FindByPath(KFile(),&KPath());
<a name="l00211"></a>00211
<a name="l00212"></a>00212 <span class="keywordflow">if</span>(panoramaPluginSupport == KErrNone)
<a name="l00213"></a>00213 {
<a name="l00214"></a>00214 app-><a class="code" href="class_c_icl_example.html#0d1ba39bdcc34903e36f3a68e5073dd1">BasicPanoramaStitchingL</a>();
<a name="l00215"></a>00215 gConsole->Printf(KBPStitching);
<a name="l00216"></a>00216 <span class="comment">//Stitch images together to form a panorama based on viewfinder tracking</span>
<a name="l00217"></a>00217 app-><a class="code" href="class_c_icl_example.html#9e85580d3fd8c310004d3175209eaf70">ViewFinderImageTrackingL</a>();
<a name="l00218"></a>00218 gConsole->Printf(KVFTStitching);
<a name="l00219"></a>00219 }
<a name="l00220"></a>00220
<a name="l00221"></a>00221 gConsole->Printf(KPressAKey);
<a name="l00222"></a>00222 gConsole->Getch();
<a name="l00223"></a>00223
<a name="l00224"></a>00224 <span class="comment">/*</span>
<a name="l00225"></a>00225 <span class="comment"> Various Decode functions</span>
<a name="l00226"></a>00226 <span class="comment"> */</span>
<a name="l00227"></a>00227 gConsole->Printf(KDecode);
<a name="l00228"></a>00228
<a name="l00229"></a>00229 <span class="comment">// Decode descriptor to bitmap</span>
<a name="l00230"></a>00230 app-><a class="code" href="class_c_icl_example.html#932e5b95f92e651980d2c6720c8fd86d">DecodeFromDescriptorToBitmapL</a>(KBitmapFile);
<a name="l00231"></a>00231 gConsole->Printf(KDecodeFromDescriptorToBitmap);
<a name="l00232"></a>00232
<a name="l00233"></a>00233 <span class="comment">// Decode from image file to bitmap</span>
<a name="l00234"></a>00234 app-><a class="code" href="class_c_icl_example.html#f04196b4645c4aacad4f969f3a6ade0f">DecodeFromFileToBitmapL</a>(KBitmapFile);
<a name="l00235"></a>00235 gConsole->Printf(KDecodeFromDescriptorAndFile, &KBitmapFile);
<a name="l00236"></a>00236
<a name="l00237"></a>00237 <span class="comment">// Decode to image frame YUV</span>
<a name="l00238"></a>00238 app-><a class="code" href="class_c_icl_example.html#59c8518cca1e856ec9977c77c133ba57">DecodeToYuvFrameL</a>(KYuvBitmap);
<a name="l00239"></a>00239 gConsole->Printf(KDecodeToYuv, &KYuvBitmap);
<a name="l00240"></a>00240
<a name="l00241"></a>00241 <span class="comment">// Decode to ½, ¼ and 1/8 sized bitmaps</span>
<a name="l00242"></a>00242 app-><a class="code" href="class_c_icl_example.html#516e94636add0b5553afd5ca9e6b0dac">DecodeToHalfFourthAndEighthSizedBitmapL</a>(KBitmapFile);
<a name="l00243"></a>00243 gConsole->Printf(KDecodeToHalfFourthAndEighthSizedBmp, &KBitmapFile);
<a name="l00244"></a>00244
<a name="l00245"></a>00245 <span class="comment">// Decode using image mask</span>
<a name="l00246"></a>00246 app-><a class="code" href="class_c_icl_example.html#22e8c59d2313f074a3e29df89e20e05f">DecodeUsingImageMaskL</a>(KMultiFrameClock);
<a name="l00247"></a>00247 gConsole->Printf(KDecodeUsingImageMask);
<a name="l00248"></a>00248
<a name="l00249"></a>00249 <span class="comment">// Multi-frame Image Decode</span>
<a name="l00250"></a>00250 app-><a class="code" href="class_c_icl_example.html#c12f19a867f25b00a89c80548f357074">MultiFrameImageDecodeL</a>(KMultiFrameClock);
<a name="l00251"></a>00251 gConsole->Printf(KImageMaskAndMultiFrameImageDecode, &KMultiFrameClock);
<a name="l00252"></a>00252
<a name="l00253"></a>00253 <span class="comment">// Decode using separate thread</span>
<a name="l00254"></a>00254 app-><a class="code" href="class_c_icl_example.html#c0261a59e3225afd05e2c82c95d1fe58">DecodeUsingSepThreadL</a>(KBitmapFile);
<a name="l00255"></a>00255 gConsole->Printf(KDecodeUsingSepThread);
<a name="l00256"></a>00256
<a name="l00257"></a>00257 <span class="comment">// Decode using continue convert</span>
<a name="l00258"></a>00258 app-><a class="code" href="class_c_icl_example.html#0d936aabff37b0f9f29dcc2216525bca">DecodeUsingContinueConvertL</a>(KBitmapFile);
<a name="l00259"></a>00259 gConsole->Printf(KSeparateThreadAndCancelAndContinueConvert, &KBitmapFile);
<a name="l00260"></a>00260
<a name="l00261"></a>00261 <span class="comment">// JPEG thumbnail access</span>
<a name="l00262"></a>00262 app-><a class="code" href="class_c_icl_example.html#81fa0479879d15a817fff1809ac17854">AccessThumbnailToDecodeL</a>(KThumbFile);
<a name="l00263"></a>00263 gConsole->Printf(KAccessThumbnailToDecode);
<a name="l00264"></a>00264
<a name="l00265"></a>00265 <span class="comment">// Access Exif metadata</span>
<a name="l00266"></a>00266 app-><a class="code" href="class_c_icl_example.html#c007f7bd46e86ce6bfbf87137ef0a064">AccessExifMetadataL</a>(KBitmapExif);
<a name="l00267"></a>00267 gConsole->Printf(KAccessExifMetadata);
<a name="l00268"></a>00268
<a name="l00269"></a>00269 <span class="comment">// Decode the thumbnail part of the image</span>
<a name="l00270"></a>00270 app-><a class="code" href="class_c_icl_example.html#6046f80ebdc6a7f8e4ce23f31faef8a0">DecodeTheThumbnailL</a>(KThumbFile);
<a name="l00271"></a>00271 gConsole->Printf(KAccessExifThumbnailAndDecodeThumbnail, &KThumbFile);
<a name="l00272"></a>00272
<a name="l00273"></a>00273 <span class="comment">// Decode and display image comments</span>
<a name="l00274"></a>00274 app-><a class="code" href="class_c_icl_example.html#34bbe8a8211f9087de9f44c0df5a5651">DisplayingImageCommentsL</a>(KBitmapComment);
<a name="l00275"></a>00275 gConsole->Printf(KDisplayingImageComments);
<a name="l00276"></a>00276
<a name="l00277"></a>00277 <span class="comment">// Decode and display frame comments</span>
<a name="l00278"></a>00278 app-><a class="code" href="class_c_icl_example.html#1845f7f61a5ff996982e129c509940b4">DisplayingFrameCommentsL</a>(KBitmapFrameComment);
<a name="l00279"></a>00279 gConsole->Printf(KImageAndFrameComment);
<a name="l00280"></a>00280
<a name="l00281"></a>00281 <span class="comment">// Get the MIME type of a source image descriptor, and load a decoder using a MIME type</span>
<a name="l00282"></a>00282 app-><a class="code" href="class_c_icl_example.html#f2d1182373eada0e38611d2f4a150402">GettingMimeTypeOfSourceDescriptorL</a>(KBitmapFile);
<a name="l00283"></a>00283 gConsole->Printf(KGettingMimeTypeOfSourceDescriptor);
<a name="l00284"></a>00284
<a name="l00285"></a>00285 <span class="comment">// Get the MIME type of a source image file, and load a decoder using a MIME type</span>
<a name="l00286"></a>00286 app-><a class="code" href="class_c_icl_example.html#65106c28709a5afee5bdfcd263901f1d">GettingMimeTypeOfSourceFileL</a>(KBitmapFile);
<a name="l00287"></a>00287 gConsole->Printf(KGettingMimeTypeFromSourceAndFile, &KBitmapFile);
<a name="l00288"></a>00288
<a name="l00289"></a>00289 <span class="comment">// Decode Bitmap including rotating an image</span>
<a name="l00290"></a>00290 app-><a class="code" href="class_c_icl_example.html#01c633fc627eeddf9446eafa62b0b0e6">DecodeWithRotateL</a>(KBitmapFile);
<a name="l00291"></a>00291 gConsole->Printf(KFileRotateAfterDecode, &KBitmapFile);
<a name="l00292"></a>00292
<a name="l00293"></a>00293 <span class="comment">// Load a Plugin by specific UID</span>
<a name="l00294"></a>00294 app-><a class="code" href="class_c_icl_example.html#36e3a8ae84f3813e028dee1ad6e9bc3e">LoadPluginByUidL</a>(KBitmapExif, KImageTypeJPGUid);
<a name="l00295"></a>00295 gConsole->Printf(KPluginLoadedSpecificToUID);
<a name="l00296"></a>00296
<a name="l00297"></a>00297 <span class="comment">// Stream Decode and stream encode YUV image frame </span>
<a name="l00298"></a>00298 app-><a class="code" href="class_c_icl_example.html#4093d046baf1ea4eeb4cfceca4ff0ac4">BlockStreamDecodeAndEncodeYuvFrameL</a>(KYuvBitmap, KDestStreamFile);
<a name="l00299"></a>00299 gConsole->Printf(KStreamYuv, &KYuvBitmap);
<a name="l00300"></a>00300
<a name="l00301"></a>00301 <span class="comment">// Apply clipping, scaling and rotation during image decode.</span>
<a name="l00302"></a>00302 app-><a class="code" href="class_c_icl_example.html#6cca2915ce3512e8ed842715449b8ce4">ClipAndRotateDuringDecodeL</a>();
<a name="l00303"></a>00303
<a name="l00304"></a>00304 gConsole->Printf(KPressAKey);
<a name="l00305"></a>00305 gConsole->Getch();
<a name="l00306"></a>00306
<a name="l00307"></a>00307
<a name="l00308"></a>00308 <span class="comment">/*</span>
<a name="l00309"></a>00309 <span class="comment"> various encode functions</span>
<a name="l00310"></a>00310 <span class="comment"> */</span>
<a name="l00311"></a>00311 gConsole->Printf(KEncode);
<a name="l00312"></a>00312
<a name="l00313"></a>00313 <span class="comment">// Encode image frame (YUV) to descriptor</span>
<a name="l00314"></a>00314 app-><a class="code" href="class_c_icl_example.html#d62bffc043397eb7306cfb0d1bf427df">EncodeBitmapToDescriptorL</a>(KSourceBitmap);
<a name="l00315"></a>00315 gConsole->Printf(KFileEncode, &KSourceBitmap);
<a name="l00316"></a>00316
<a name="l00317"></a>00317 <span class="comment">// JPEG thumbnail access</span>
<a name="l00318"></a>00318 app-><a class="code" href="class_c_icl_example.html#e104f588c16e81bfbfe09e6cfc43ef16">EncodeImageWithThumbnailL</a>(KSourceBitmap);
<a name="l00319"></a>00319 gConsole->Printf(KEncodeImageWithThumbnail);
<a name="l00320"></a>00320
<a name="l00321"></a>00321 <span class="comment">// Setting EXIF metadata</span>
<a name="l00322"></a>00322 app-><a class="code" href="class_c_icl_example.html#dc8169ae5510b9b6d5e55c28e08574c5">SettingExifMetadataL</a>(KSourceBitmap);
<a name="l00323"></a>00323 gConsole->Printf(KAccessToThumbnailAndExifSetting);
<a name="l00324"></a>00324
<a name="l00325"></a>00325 <span class="comment">// Rotating a bitmap</span>
<a name="l00326"></a>00326 app-><a class="code" href="class_c_icl_example.html#52e7ceb0f0468de45b9b493350db2af4">RotateBitmapL</a>(KSourceBitmap);
<a name="l00327"></a>00327 gConsole->Printf(KFileRotate);
<a name="l00328"></a>00328
<a name="l00329"></a>00329 <span class="comment">// Scaling a bitmap (including optional selection of low memory and quality algorithms)</span>
<a name="l00330"></a>00330 app-><a class="code" href="class_c_icl_example.html#b5cd4b4ee195f9ff7cc635e559603d0a">ScaleBitmapL</a>(KSourceBitmap);
<a name="l00331"></a>00331 gConsole->Printf(KScaleBitmap);
<a name="l00332"></a>00332
<a name="l00333"></a>00333 <span class="comment">// Set Source to File and destination to descriptor and resize</span>
<a name="l00334"></a>00334 app-><a class="code" href="class_c_icl_example.html#437f4725accedc8e924ee6c897ed0498">SetSourceDestinationandResizeL</a>(KBitmapExif);
<a name="l00335"></a>00335 gConsole->Printf(KSetSourceDestinationandResize);
<a name="l00336"></a>00336
<a name="l00337"></a>00337 <span class="comment">// Set Source to descriptor and destination to File and resize</span>
<a name="l00338"></a>00338 app-><a class="code" href="class_c_icl_example.html#cba98bc6b971306f2e568413caae443d">SettingWithUseOfPreserveImageDataL</a>(KYuvBitmap,KYuvDestBitmap);
<a name="l00339"></a>00339 gConsole->Printf(KSetSourceAndDestinationAndResize);
<a name="l00340"></a>00340
<a name="l00341"></a>00341 <span class="comment">// Adding thumbnail to JPEG file</span>
<a name="l00342"></a>00342 app-><a class="code" href="class_c_icl_example.html#13e9de7f38143107e3ddf23808a822c3">AddThumbnailToJpegFileL</a>(KBitmapExif, KYuvDestBitmap);
<a name="l00343"></a>00343 gConsole->Printf(KAddThumbnailToJpegFile);
<a name="l00344"></a>00344
<a name="l00345"></a>00345 <span class="comment">// Adding Exif data to JPEG file</span>
<a name="l00346"></a>00346 app-><a class="code" href="class_c_icl_example.html#fc6a5f0e8468d977d0b1d11001c773b7">AddExifDataToJpegFileL</a>(KSourceBitmap);
<a name="l00347"></a>00347 gConsole->Printf(KExifAndThumbnailAdded);
<a name="l00348"></a>00348
<a name="l00349"></a>00349 <span class="comment">// Apply rotation operation while encoding bitmap to Jpeg</span>
<a name="l00350"></a>00350 app-><a class="code" href="class_c_icl_example.html#5f453ea5f17eeeadbf0558774c9947f4">EncodeBitmapToFileUsingOperationExtensionL</a>(KBitmapRotateWhileEncodeToJpeg, KDestRotateFile);
<a name="l00351"></a>00351 gConsole->Printf(KEncodeRotate, &KDestRotateFile);
<a name="l00352"></a>00352
<a name="l00353"></a>00353 gConsole->Printf(KPressAKey);
<a name="l00354"></a>00354 gConsole->Getch();
<a name="l00355"></a>00355
<a name="l00356"></a>00356 <span class="comment">// Spmo</span>
<a name="l00357"></a>00357 <span class="comment">// Generating Spmo</span>
<a name="l00358"></a>00358 gConsole->Printf(KGeneratingSpmo);
<a name="l00359"></a>00359 app-><a class="code" href="class_c_icl_example.html#ffa7926ab6294a9cb96ca59ab6beed86">GeneratingSpmoL</a>();
<a name="l00360"></a>00360
<a name="l00361"></a>00361 <span class="comment">// Generating Spmo iteratively</span>
<a name="l00362"></a>00362 gConsole->Printf(KGeneratingSpmoIteratively);
<a name="l00363"></a>00363 app-><a class="code" href="class_c_icl_example.html#c0cb91c06d60b36516ee1113ec509bab">GeneratingSpmoIterativelyL</a>();
<a name="l00364"></a>00364
<a name="l00365"></a>00365 gConsole->Printf(KPressAKey);
<a name="l00366"></a>00366 gConsole->Getch();
<a name="l00367"></a>00367
<a name="l00368"></a>00368 <span class="comment">// Image Processor</span>
<a name="l00369"></a>00369 <span class="comment">// Basic image processing</span>
<a name="l00370"></a>00370 _LIT(KFile1,<span class="stringliteral">"capsimageprocessorplugin.rsc"</span>);
<a name="l00371"></a>00371 TInt imageProcessorPluginSupport;
<a name="l00372"></a>00372 imageProcessorPluginSupport = file.FindByPath(KFile1(),&KPath());
<a name="l00373"></a>00373 <span class="keywordflow">if</span>(imageProcessorPluginSupport == KErrNone)
<a name="l00374"></a>00374 {
<a name="l00375"></a>00375 gConsole->Printf(KBasicImageProcessing);
<a name="l00376"></a>00376 app-><a class="code" href="class_c_icl_example.html#16e34be3bbdf829cf58dba907e9bc53c">BasicImageProcessingL</a>();
<a name="l00377"></a>00377 <span class="comment">// Basic image processing with effects applied</span>
<a name="l00378"></a>00378 gConsole->Printf(KBasicEffectImageProcessing);
<a name="l00379"></a>00379 app-><a class="code" href="class_c_icl_example.html#2a279b168c7145fb92f6fe6fc534c0f1">BasicEffectImageProcessingL</a>();
<a name="l00380"></a>00380 <span class="comment">// Image processing with undo</span>
<a name="l00381"></a>00381 gConsole->Printf(KEffectImageProcessingWithUndo);
<a name="l00382"></a>00382 app-><a class="code" href="class_c_icl_example.html#0a48c925a0ce381333c16d8e046aea2f">EffectImageProcessingWithUndoL</a>();
<a name="l00383"></a>00383 <span class="comment">// Image processing with preview</span>
<a name="l00384"></a>00384 gConsole->Printf(KEffectImageProcessingWithPreview);
<a name="l00385"></a>00385 app-><a class="code" href="class_c_icl_example.html#882b254fff2e471331d2f690d4e485aa">EffectImageProcessingWithPreviewL</a>();
<a name="l00386"></a>00386 <span class="comment">// Image processing with overlay</span>
<a name="l00387"></a>00387 gConsole->Printf(KEffectImageProcessingWithOverlay);
<a name="l00388"></a>00388 app-><a class="code" href="class_c_icl_example.html#da63b9baa84fb3fe22b1976ca84a2156">EffectImageProcessingWithOverlayL</a>();
<a name="l00389"></a>00389 <span class="comment">// Image processing with spmo</span>
<a name="l00390"></a>00390 gConsole->Printf(KImageProcessingWithSpmo);
<a name="l00391"></a>00391 app-><a class="code" href="class_c_icl_example.html#906019f9b590b09c52f78f246d681437">ImageProcessingWithSpmoL</a>();
<a name="l00392"></a>00392 }
<a name="l00393"></a>00393
<a name="l00394"></a>00394 <span class="comment">// Various Image Transform Functions</span>
<a name="l00395"></a>00395 gConsole->Printf(KImageTransform);
<a name="l00396"></a>00396 <span class="comment">// Squeeze a Jpg Image in a file to a file</span>
<a name="l00397"></a>00397 _LIT(KFile2,<span class="stringliteral">"capsimagetransformplugin.rsc"</span>);
<a name="l00398"></a>00398 TInt imageTransformPluginSupport;
<a name="l00399"></a>00399 imageTransformPluginSupport = file.FindByPath(KFile2(),&KPath());
<a name="l00400"></a>00400 <span class="keywordflow">if</span>(imageTransformPluginSupport == KErrNone)
<a name="l00401"></a>00401 {
<a name="l00402"></a>00402 gConsole->Printf(KSqueezeFileToFile);
<a name="l00403"></a>00403 app-><a class="code" href="class_c_icl_example.html#01e8b801b449b110507d038fd29c0465">SqueezeJpgFileToFileL</a>(KSourceJpgDatetree, KSqueezeDestJpgDatetreeFileToFile);
<a name="l00404"></a>00404 <span class="comment">// Squeeze a Jpg Image in a buffer to a buffer</span>
<a name="l00405"></a>00405 gConsole->Printf(KSqueezeBufferToBuffer);
<a name="l00406"></a>00406 app-><a class="code" href="class_c_icl_example.html#5a2b4947cd5af165546515ee95742419">SqueezeJpgBufferToBufferL</a>(KSourceJpgDatetree, KSqueezeDestJpgDatetreeBufferToBuffer);
<a name="l00407"></a>00407 <span class="comment">// Auto-Squeeze a Jpg Image in a file to a file</span>
<a name="l00408"></a>00408 gConsole->Printf(KAutoSqueezeFileToFile);
<a name="l00409"></a>00409 app-><a class="code" href="class_c_icl_example.html#ad1303bafe8aac71274efa90558f29ff">AutoSqueezeJpgFileToFileL</a>(KSourceJpgCapstest, KAutoSqueezeDestJpgCapstest);
<a name="l00410"></a>00410 <span class="comment">// Rotate a Jpg Image in a file to a file</span>
<a name="l00411"></a>00411 gConsole->Printf(KRotateFileToFile);
<a name="l00412"></a>00412 app-><a class="code" href="class_c_icl_example.html#0afdb26ddecd25134d6c33109f9ce99f">RotateJpgFileToFileL</a>(KSourceJpgCapstest, KRotate90DestJpgCapstest);
<a name="l00413"></a>00413 <span class="comment">// Overlay a Jpg Image in a buffer to a file to a file</span>
<a name="l00414"></a>00414 gConsole->Printf(KOverlayJpgDataFileToFile);
<a name="l00415"></a>00415 app-><a class="code" href="class_c_icl_example.html#5a9a18e5cb34223269cf92d0367d7dd2">OverlayJpgDataToJpgFileToFileL</a>(KSourceJpgDatetree, KSourceJpgOverlay, KOverlayDestJpgDataFileToFile);
<a name="l00416"></a>00416 <span class="comment">// Overlay a Bitmap in a buffer to a file to a file</span>
<a name="l00417"></a>00417 gConsole->Printf(KOverlayBmpDataFileToFile);
<a name="l00418"></a>00418 app-><a class="code" href="class_c_icl_example.html#3c18c273d702e32b9d4e196e38edfa46">OverlayBmpDataToJpgFileToFileL</a>(KSourceJpgCapstest, KSourceMbmOverlay, KOverlayDestBitmapFileToFile);
<a name="l00419"></a>00419 <span class="comment">// Overlay a Png Image in a file to a file to a file</span>
<a name="l00420"></a>00420 gConsole->Printf(KOverlayPngFileToFile);
<a name="l00421"></a>00421 app-><a class="code" href="class_c_icl_example.html#dfaa0ee7346aa45a9ef50d9fe7295404">OverlayPngFileToJpgFileToFileL</a>(KSourceJpgCapstest, KSourcePngOverlay, KOverlayDestPngFileToFile);
<a name="l00422"></a>00422 }
<a name="l00423"></a>00423 gConsole->Printf(KExitMsg);
<a name="l00424"></a>00424 gConsole->Getch();
<a name="l00425"></a>00425 fsSession.Close();
<a name="l00426"></a>00426 CleanupStack::PopAndDestroy(3);<span class="comment">// app, scheduler, gConsole</span>
<a name="l00427"></a>00427 }
<a name="l00428"></a>00428
<a name="l00429"></a>00429
<a name="l00430"></a><a class="code" href="iclmainexample_8cpp.html#0f358e9c4355138f629b8c4f37310295">00430</a> GLDEF_C TInt <a class="code" href="dbllist_8cpp.html#0f358e9c4355138f629b8c4f37310295">E32Main</a>()
<a name="l00431"></a>00431 {
<a name="l00432"></a>00432 __UHEAP_MARK;
<a name="l00433"></a>00433
<a name="l00434"></a>00434 CTrapCleanup* cleanup = CTrapCleanup::New();
<a name="l00435"></a>00435 <span class="keywordflow">if</span> (cleanup == NULL)
<a name="l00436"></a>00436 {
<a name="l00437"></a>00437 <span class="keywordflow">return</span> KErrNoMemory;
<a name="l00438"></a>00438 }
<a name="l00439"></a>00439
<a name="l00440"></a>00440 TRAPD(err, <a class="code" href="circularbuffer_8cpp.html#5fb473d4ee18739183215b04dcad6e12">MainL</a>());
<a name="l00441"></a>00441
<a name="l00442"></a>00442 <span class="keyword">delete</span> cleanup;
<a name="l00443"></a>00443 __UHEAP_MARKEND;
<a name="l00444"></a>00444
<a name="l00445"></a>00445 <span class="keywordflow">return</span> err;
<a name="l00446"></a>00446 }
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 21 10:32:59 2010 for TB10.1 Example Applications by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>