1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
25 #include <icl/imagecodecdata.h>
27 const TInt KPanoramaDefaultOverlap = 63; //Default overlap value in percent.
28 const TInt KPanoramaDefaultDirectionTrigger = 10; //Default direction value in percent.
29 const TInt KPanLensIndex = 2; //Focal length and principal point index value
30 const TInt KPanLensDist = 5; //Distortion index value
33 class CImagePanoramaImpl;
35 class CPanoramaTransformImpl;
43 EPanoramaDirectionUnknown = 0,
44 EPanoramaDirectionRight,
45 EPanoramaDirectionLeft,
47 EPanoramaDirectionDown
51 This class provides the lens parameters that describe the internal camera characteristics.
56 IMPORT_C TPanoramaLens();
57 IMPORT_C TPanoramaLens(TReal32* aFocalLength, TReal32* aPrincipalPoint, TReal32 aSkew, TReal32* aDist, TUint32 aWidth, TUint32 aHeight);
60 TReal32 iFocalLength[KPanLensIndex]; //Focal length coordinates
61 TReal32 iPrincipalPoint[KPanLensIndex]; //Principal point coordinates
62 TReal32 iSkew; //Skew coefficient. @remark 0.0f means no skew
63 TReal32 iDist[KPanLensDist];// Distortion coefficients. If there are fewer parameter values available, fill the last values with zeros
64 TUint32 iWidth; // Image width when the camera was calibrated
65 TUint32 iHeight; // Image height when the camera was calibrated
76 This class provides help functions for handling the result of the viewfinder tracking.
77 It contains getters and setters.
79 class CPanoramaTransform : public CBase
82 IMPORT_C static CPanoramaTransform* NewL();
84 IMPORT_C void GetTranslation(TPoint& aDxDy, TSize& aDims) const;
85 IMPORT_C void SetTranslationL(const TPoint& aDxDy, const TSize& aDims);
86 IMPORT_C void GetDirection(TDirection& aDirection);
87 IMPORT_C void GetDirection(TDirection& aDirection, TInt& aMinimumDelta);
88 IMPORT_C void SetDirection(TDirection& aDirection);
89 IMPORT_C void SetDirection(TDirection& aDirection, TInt aMinDelta);
91 IMPORT_C ~CPanoramaTransform();
98 CPanoramaTransformImpl* iPanTransImpl;
102 This class provides functions to register the image that has got from viewfinder
103 and checks the appropriate time to capture that image.
105 class CVFTracker : public CBase
108 IMPORT_C static CVFTracker* NewL();
110 IMPORT_C void RegisterImageL(const CFbsBitmap& aBitmap, CPanoramaTransform& aPanTrans);
111 IMPORT_C void RegisterImageL(const CImageFrame& aImageFrame, CPanoramaTransform& aPanTrans);
112 IMPORT_C TBool IsTimeToCapture(TDirection& aDirection) const;
113 IMPORT_C TBool IsTimeToCapture(TDirection& aDirection, TInt aOverlap) const;
114 IMPORT_C void Reset();
115 IMPORT_C void InitializeL(const TSize& aSize);
117 IMPORT_C TAny* Extension(TUid aExtension);
119 IMPORT_C ~CVFTracker();
126 CVFTrackerImpl* iVFTrackImpl;
130 This class provides functions to get basic stitching. Input can be a file,
131 descriptor, bitmap, imageframe.
133 class CImagePanorama : public CBase
136 IMPORT_C static CImagePanorama* NewL();
138 IMPORT_C void AddFileL(const TDesC& aFilename, CPanoramaTransform& aPanTrans);
139 IMPORT_C void AddBufferL(const TDesC8& aData, CPanoramaTransform& aPanTrans);
140 IMPORT_C void AddImageL(const CFbsBitmap& aBitmap, CPanoramaTransform& aPanTrans);
141 IMPORT_C void AddImageL(const CImageFrame& aImageFrame, CPanoramaTransform& aPanTrans);
143 IMPORT_C void CurrentImageSizeL(TSize& aSize);
145 IMPORT_C void RenderL(const TDesC& aFilename);
146 IMPORT_C void RenderL(const TDesC& aFilename, const TSize& aSize, const TBool aMaintainAspectRatio, const TUid& aImageTypeUid);
148 IMPORT_C void RenderL(RFile& aFile);
149 IMPORT_C void RenderL(RFile& aFile, const TSize& aSize, const TBool aMaintainAspectRatio, const TUid& aImageTypeUid);
151 IMPORT_C void RenderL(HBufC8*& aDestData);
152 IMPORT_C void RenderL(HBufC8*& aDestData, TUint32 aMaxBufferSize, const TSize& aSize, const TBool aMaintainAspectRatio, const TUid& aImageTypeUid);
154 IMPORT_C void RenderL(const CFbsBitmap& aBitmap);
155 IMPORT_C void RenderL(const CFbsBitmap& aBitmap, const TBool aMaintainAspectRatio);
157 IMPORT_C void RenderL(const CImageFrame& aImageFrame);
158 IMPORT_C void RenderL(const CImageFrame& aImageFrame, const TBool aMaintainAspectRatio);
160 IMPORT_C void InitializeL(const TSize & aSize, const TPanoramaLens& aPanoramaLens, const TDirection& aDirection);
162 IMPORT_C TAny* Extension(TUid aExtension);
164 IMPORT_C ~CImagePanorama();
171 CImagePanoramaImpl* iImgPanImpl;