annotate DemoCube/src/ImageLoader.cpp @ 1:0a2b5a968ce7

Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
author Atul Varma <varmaa@toolness.com>
date Tue, 12 Feb 2008 17:32:01 -0600
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
1 /*=====================================================================
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
2
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
3 Copyright © 2007 Nokia Corporation. All rights reserved.
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
4
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
5 ======================================================================*/
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
6
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
7 // ImageSaver.cpp: implementation of the CImageLoader class.
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
8 //
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
9 //////////////////////////////////////////////////////////////////////
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
10
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
11 #include <eikenv.h> // for CEikonEnv - "Eikon Environment"
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
12 #include <PathInfo.h>
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
13 #include <ImageConversion.h>
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
14
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
15 #include "ImageLoader.h"
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
16
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
17 _LIT8(KMimeType,"image/png");
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
18
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
19 //////////////////////////////////////////////////////////////////////
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
20 // Construction/Destruction
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
21 //////////////////////////////////////////////////////////////////////
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
22
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
23 void CImageLoader::ConstructL()
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
24 {
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
25 }
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
26
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
27
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
28 CImageLoader* CImageLoader::NewL(TChar tDrive)
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
29 {
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
30 CImageLoader* self = new (ELeave) CImageLoader(tDrive);
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
31
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
32 CleanupStack::PushL( self );
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
33 self->ConstructL();
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
34 CleanupStack::Pop();
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
35
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
36 return self;
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
37 }
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
38
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
39
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
40 CImageLoader::CImageLoader(TChar tDrive):CActive( CActive::EPriorityStandard )
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
41 {
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
42 CActiveScheduler::Add( this );
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
43
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
44 pImageDecoder = NULL;
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
45 iDrive = tDrive;
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
46 }
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
47
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
48
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
49 CImageLoader::~CImageLoader()
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
50 {
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
51 if (pImageDecoder)
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
52 delete pImageDecoder;
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
53 pImageDecoder = NULL;
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
54
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
55 // delete iImagePath;
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
56 }
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
57
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
58
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
59 //functions
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
60 void CImageLoader::DoCancel()
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
61 {
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
62 //in case image saving is cancelled for whatever reason
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
63 pImageDecoder->Cancel();
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
64
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
65 DeleteDecoder();
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
66 }
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
67
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
68
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
69 void CImageLoader::RunL()
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
70 {
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
71 if (iStatus != KErrNone) {
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
72 TRequestStatus* s=&iStatus;
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
73 User::RequestComplete(s, KErrNone);
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
74
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
75 SetActive();
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
76 return;
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
77 }
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
78
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
79 DeleteDecoder();
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
80 }
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
81
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
82
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
83 void CImageLoader::RunError()
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
84 {
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
85 RunL(); //cleanup
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
86 }
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
87
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
88
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
89 void CImageLoader::DeleteDecoder()
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
90 {
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
91 if (pImageDecoder)
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
92 delete pImageDecoder;
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
93 pImageDecoder = NULL;
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
94 }
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
95
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
96
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
97 void CImageLoader::LoadImage(const TDesC &aFilename, CFbsBitmap *pImg)
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
98 {
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
99 RFs fSystem = CEikonEnv::Static()->FsSession();
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
100
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
101 #if defined( __WINS__ )
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
102 _LIT(SpriteFilePath, "%c:\\pictures\\"); // Path for emulator build
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
103 iFilename.Format( SpriteFilePath, iDrive );
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
104 iFilename.Append(aFilename);
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
105 #else
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
106 // _LIT(KFileName, "%c:\\system\\apps\\Track\\"); // Path for HW release
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
107 _LIT(SpriteFilePath, "%c:\\"); // Path for HW release
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
108 iFilename.Format( SpriteFilePath, (char)iDrive );
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
109 iFilename.Append(aFilename);
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
110 #endif
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
111
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
112 iNewFileName.Copy(iFilename);
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
113
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
114 if (!pImageDecoder)
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
115 pImageDecoder = CImageDecoder::FileNewL(fSystem, iNewFileName, KMimeType, CImageDecoder::EOptionAlwaysThread );
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
116
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
117 //if not busy, start to do the conversion
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
118 if ( !IsActive() ) {
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
119 pImageDecoder->Convert( &iStatus, *pImg );
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
120 SetActive();
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
121
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
122 //loop until the encoding is done
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
123 do {
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
124 // SleepForSecs(1);
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
125 SleepForMicrosecs(1);
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
126 } while (iStatus != KErrNone);
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
127 }
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
128 }
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
129
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
130
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
131
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
132 void CImageLoader::SleepForMicrosecs(TInt iMicroSecsToSleep)
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
133 {
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
134 TTime tNow;
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
135 tNow.HomeTime();
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
136
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
137 TTimeIntervalMicroSeconds tMicroSecsToSleep;
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
138 tMicroSecsToSleep = iMicroSecsToSleep;
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
139
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
140 //sleep for iMicroSecsToSleep
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
141 User::At(tNow + tMicroSecsToSleep);
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
142
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
143 }
0a2b5a968ce7 Modifications that turn this Nokia-supplied DemoCube demo into a web-browser mockup that uses optical flow for panning operations.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
144