williamr@4
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@4
|
2 |
// All rights reserved.
|
williamr@4
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@4
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@4
|
7 |
//
|
williamr@4
|
8 |
// Initial Contributors:
|
williamr@4
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@4
|
10 |
//
|
williamr@4
|
11 |
// Contributors:
|
williamr@4
|
12 |
//
|
williamr@4
|
13 |
// Description:
|
williamr@4
|
14 |
//
|
williamr@4
|
15 |
|
williamr@4
|
16 |
/**
|
williamr@4
|
17 |
@file
|
williamr@4
|
18 |
@publishedAll
|
williamr@4
|
19 |
@released
|
williamr@4
|
20 |
*/
|
williamr@4
|
21 |
|
williamr@4
|
22 |
#ifndef PANORAMA_H
|
williamr@4
|
23 |
#define PANORAMA_H
|
williamr@4
|
24 |
|
williamr@4
|
25 |
#include <icl/imagecodecdata.h>
|
williamr@4
|
26 |
|
williamr@4
|
27 |
const TInt KPanoramaDefaultOverlap = 63; //Default overlap value in percent.
|
williamr@4
|
28 |
const TInt KPanoramaDefaultDirectionTrigger = 10; //Default direction value in percent.
|
williamr@4
|
29 |
const TInt KPanLensIndex = 2; //Focal length and principal point index value
|
williamr@4
|
30 |
const TInt KPanLensDist = 5; //Distortion index value
|
williamr@4
|
31 |
|
williamr@4
|
32 |
//fwd ref
|
williamr@4
|
33 |
class CImagePanoramaImpl;
|
williamr@4
|
34 |
class CVFTrackerImpl;
|
williamr@4
|
35 |
class CPanoramaTransformImpl;
|
williamr@4
|
36 |
class CImageFrame;
|
williamr@4
|
37 |
|
williamr@4
|
38 |
/**
|
williamr@4
|
39 |
Defines the direction
|
williamr@4
|
40 |
*/
|
williamr@4
|
41 |
enum TDirection
|
williamr@4
|
42 |
{
|
williamr@4
|
43 |
EPanoramaDirectionUnknown = 0,
|
williamr@4
|
44 |
EPanoramaDirectionRight,
|
williamr@4
|
45 |
EPanoramaDirectionLeft,
|
williamr@4
|
46 |
EPanoramaDirectionUp,
|
williamr@4
|
47 |
EPanoramaDirectionDown
|
williamr@4
|
48 |
};
|
williamr@4
|
49 |
|
williamr@4
|
50 |
/**
|
williamr@4
|
51 |
This class provides the lens parameters that describe the internal camera characteristics.
|
williamr@4
|
52 |
*/
|
williamr@4
|
53 |
class TPanoramaLens
|
williamr@4
|
54 |
{
|
williamr@4
|
55 |
public:
|
williamr@4
|
56 |
IMPORT_C TPanoramaLens();
|
williamr@4
|
57 |
IMPORT_C TPanoramaLens(TReal32* aFocalLength, TReal32* aPrincipalPoint, TReal32 aSkew, TReal32* aDist, TUint32 aWidth, TUint32 aHeight);
|
williamr@4
|
58 |
|
williamr@4
|
59 |
public:
|
williamr@4
|
60 |
TReal32 iFocalLength[KPanLensIndex]; //Focal length coordinates
|
williamr@4
|
61 |
TReal32 iPrincipalPoint[KPanLensIndex]; //Principal point coordinates
|
williamr@4
|
62 |
TReal32 iSkew; //Skew coefficient. @remark 0.0f means no skew
|
williamr@4
|
63 |
TReal32 iDist[KPanLensDist];// Distortion coefficients. If there are fewer parameter values available, fill the last values with zeros
|
williamr@4
|
64 |
TUint32 iWidth; // Image width when the camera was calibrated
|
williamr@4
|
65 |
TUint32 iHeight; // Image height when the camera was calibrated
|
williamr@4
|
66 |
|
williamr@4
|
67 |
private:
|
williamr@4
|
68 |
// Future proof
|
williamr@4
|
69 |
TAny* iPad1;
|
williamr@4
|
70 |
TAny* iPad2;
|
williamr@4
|
71 |
TAny* iPad3;
|
williamr@4
|
72 |
TAny* iPad4;
|
williamr@4
|
73 |
};
|
williamr@4
|
74 |
|
williamr@4
|
75 |
/**
|
williamr@4
|
76 |
This class provides help functions for handling the result of the viewfinder tracking.
|
williamr@4
|
77 |
It contains getters and setters.
|
williamr@4
|
78 |
*/
|
williamr@4
|
79 |
class CPanoramaTransform : public CBase
|
williamr@4
|
80 |
{
|
williamr@4
|
81 |
public:
|
williamr@4
|
82 |
IMPORT_C static CPanoramaTransform* NewL();
|
williamr@4
|
83 |
|
williamr@4
|
84 |
IMPORT_C void GetTranslation(TPoint& aDxDy, TSize& aDims) const;
|
williamr@4
|
85 |
IMPORT_C void SetTranslationL(const TPoint& aDxDy, const TSize& aDims);
|
williamr@4
|
86 |
IMPORT_C void GetDirection(TDirection& aDirection);
|
williamr@4
|
87 |
IMPORT_C void GetDirection(TDirection& aDirection, TInt& aMinimumDelta);
|
williamr@4
|
88 |
IMPORT_C void SetDirection(TDirection& aDirection);
|
williamr@4
|
89 |
IMPORT_C void SetDirection(TDirection& aDirection, TInt aMinDelta);
|
williamr@4
|
90 |
|
williamr@4
|
91 |
IMPORT_C ~CPanoramaTransform();
|
williamr@4
|
92 |
|
williamr@4
|
93 |
private:
|
williamr@4
|
94 |
CPanoramaTransform();
|
williamr@4
|
95 |
void ConstructL();
|
williamr@4
|
96 |
|
williamr@4
|
97 |
private:
|
williamr@4
|
98 |
CPanoramaTransformImpl* iPanTransImpl;
|
williamr@4
|
99 |
};
|
williamr@4
|
100 |
|
williamr@4
|
101 |
/**
|
williamr@4
|
102 |
This class provides functions to register the image that has got from viewfinder
|
williamr@4
|
103 |
and checks the appropriate time to capture that image.
|
williamr@4
|
104 |
*/
|
williamr@4
|
105 |
class CVFTracker : public CBase
|
williamr@4
|
106 |
{
|
williamr@4
|
107 |
public:
|
williamr@4
|
108 |
IMPORT_C static CVFTracker* NewL();
|
williamr@4
|
109 |
|
williamr@4
|
110 |
IMPORT_C void RegisterImageL(const CFbsBitmap& aBitmap, CPanoramaTransform& aPanTrans);
|
williamr@4
|
111 |
IMPORT_C void RegisterImageL(const CImageFrame& aImageFrame, CPanoramaTransform& aPanTrans);
|
williamr@4
|
112 |
IMPORT_C TBool IsTimeToCapture(TDirection& aDirection) const;
|
williamr@4
|
113 |
IMPORT_C TBool IsTimeToCapture(TDirection& aDirection, TInt aOverlap) const;
|
williamr@4
|
114 |
IMPORT_C void Reset();
|
williamr@4
|
115 |
IMPORT_C void InitializeL(const TSize& aSize);
|
williamr@4
|
116 |
|
williamr@4
|
117 |
IMPORT_C TAny* Extension(TUid aExtension);
|
williamr@4
|
118 |
|
williamr@4
|
119 |
IMPORT_C ~CVFTracker();
|
williamr@4
|
120 |
|
williamr@4
|
121 |
private:
|
williamr@4
|
122 |
CVFTracker();
|
williamr@4
|
123 |
void ConstructL();
|
williamr@4
|
124 |
|
williamr@4
|
125 |
private:
|
williamr@4
|
126 |
CVFTrackerImpl* iVFTrackImpl;
|
williamr@4
|
127 |
};
|
williamr@4
|
128 |
|
williamr@4
|
129 |
/**
|
williamr@4
|
130 |
This class provides functions to get basic stitching. Input can be a file,
|
williamr@4
|
131 |
descriptor, bitmap, imageframe.
|
williamr@4
|
132 |
*/
|
williamr@4
|
133 |
class CImagePanorama : public CBase
|
williamr@4
|
134 |
{
|
williamr@4
|
135 |
public:
|
williamr@4
|
136 |
IMPORT_C static CImagePanorama* NewL();
|
williamr@4
|
137 |
|
williamr@4
|
138 |
IMPORT_C void AddFileL(const TDesC& aFilename, CPanoramaTransform& aPanTrans);
|
williamr@4
|
139 |
IMPORT_C void AddBufferL(const TDesC8& aData, CPanoramaTransform& aPanTrans);
|
williamr@4
|
140 |
IMPORT_C void AddImageL(const CFbsBitmap& aBitmap, CPanoramaTransform& aPanTrans);
|
williamr@4
|
141 |
IMPORT_C void AddImageL(const CImageFrame& aImageFrame, CPanoramaTransform& aPanTrans);
|
williamr@4
|
142 |
|
williamr@4
|
143 |
IMPORT_C void CurrentImageSizeL(TSize& aSize);
|
williamr@4
|
144 |
|
williamr@4
|
145 |
IMPORT_C void RenderL(const TDesC& aFilename);
|
williamr@4
|
146 |
IMPORT_C void RenderL(const TDesC& aFilename, const TSize& aSize, const TBool aMaintainAspectRatio, const TUid& aImageTypeUid);
|
williamr@4
|
147 |
|
williamr@4
|
148 |
IMPORT_C void RenderL(RFile& aFile);
|
williamr@4
|
149 |
IMPORT_C void RenderL(RFile& aFile, const TSize& aSize, const TBool aMaintainAspectRatio, const TUid& aImageTypeUid);
|
williamr@4
|
150 |
|
williamr@4
|
151 |
IMPORT_C void RenderL(HBufC8*& aDestData);
|
williamr@4
|
152 |
IMPORT_C void RenderL(HBufC8*& aDestData, TUint32 aMaxBufferSize, const TSize& aSize, const TBool aMaintainAspectRatio, const TUid& aImageTypeUid);
|
williamr@4
|
153 |
|
williamr@4
|
154 |
IMPORT_C void RenderL(const CFbsBitmap& aBitmap);
|
williamr@4
|
155 |
IMPORT_C void RenderL(const CFbsBitmap& aBitmap, const TBool aMaintainAspectRatio);
|
williamr@4
|
156 |
|
williamr@4
|
157 |
IMPORT_C void RenderL(const CImageFrame& aImageFrame);
|
williamr@4
|
158 |
IMPORT_C void RenderL(const CImageFrame& aImageFrame, const TBool aMaintainAspectRatio);
|
williamr@4
|
159 |
|
williamr@4
|
160 |
IMPORT_C void InitializeL(const TSize & aSize, const TPanoramaLens& aPanoramaLens, const TDirection& aDirection);
|
williamr@4
|
161 |
|
williamr@4
|
162 |
IMPORT_C TAny* Extension(TUid aExtension);
|
williamr@4
|
163 |
|
williamr@4
|
164 |
IMPORT_C ~CImagePanorama();
|
williamr@4
|
165 |
|
williamr@4
|
166 |
private:
|
williamr@4
|
167 |
CImagePanorama();
|
williamr@4
|
168 |
void ConstructL();
|
williamr@4
|
169 |
|
williamr@4
|
170 |
private:
|
williamr@4
|
171 |
CImagePanoramaImpl* iImgPanImpl;
|
williamr@4
|
172 |
};
|
williamr@4
|
173 |
|
williamr@4
|
174 |
#endif //PANORAMA_H
|