1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/panorama/panorama.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,174 @@
1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @publishedAll
1.22 + @released
1.23 +*/
1.24 +
1.25 +#ifndef PANORAMA_H
1.26 +#define PANORAMA_H
1.27 +
1.28 +#include <icl/imagecodecdata.h>
1.29 +
1.30 +const TInt KPanoramaDefaultOverlap = 63; //Default overlap value in percent.
1.31 +const TInt KPanoramaDefaultDirectionTrigger = 10; //Default direction value in percent.
1.32 +const TInt KPanLensIndex = 2; //Focal length and principal point index value
1.33 +const TInt KPanLensDist = 5; //Distortion index value
1.34 +
1.35 +//fwd ref
1.36 +class CImagePanoramaImpl;
1.37 +class CVFTrackerImpl;
1.38 +class CPanoramaTransformImpl;
1.39 +class CImageFrame;
1.40 +
1.41 +/**
1.42 +Defines the direction
1.43 +*/
1.44 +enum TDirection
1.45 + {
1.46 + EPanoramaDirectionUnknown = 0,
1.47 + EPanoramaDirectionRight,
1.48 + EPanoramaDirectionLeft,
1.49 + EPanoramaDirectionUp,
1.50 + EPanoramaDirectionDown
1.51 + };
1.52 +
1.53 +/**
1.54 +This class provides the lens parameters that describe the internal camera characteristics.
1.55 +*/
1.56 +class TPanoramaLens
1.57 + {
1.58 +public:
1.59 + IMPORT_C TPanoramaLens();
1.60 + IMPORT_C TPanoramaLens(TReal32* aFocalLength, TReal32* aPrincipalPoint, TReal32 aSkew, TReal32* aDist, TUint32 aWidth, TUint32 aHeight);
1.61 +
1.62 +public:
1.63 + TReal32 iFocalLength[KPanLensIndex]; //Focal length coordinates
1.64 + TReal32 iPrincipalPoint[KPanLensIndex]; //Principal point coordinates
1.65 + TReal32 iSkew; //Skew coefficient. @remark 0.0f means no skew
1.66 + TReal32 iDist[KPanLensDist];// Distortion coefficients. If there are fewer parameter values available, fill the last values with zeros
1.67 + TUint32 iWidth; // Image width when the camera was calibrated
1.68 + TUint32 iHeight; // Image height when the camera was calibrated
1.69 +
1.70 +private:
1.71 + // Future proof
1.72 + TAny* iPad1;
1.73 + TAny* iPad2;
1.74 + TAny* iPad3;
1.75 + TAny* iPad4;
1.76 + };
1.77 +
1.78 +/**
1.79 +This class provides help functions for handling the result of the viewfinder tracking.
1.80 +It contains getters and setters.
1.81 +*/
1.82 +class CPanoramaTransform : public CBase
1.83 + {
1.84 +public:
1.85 + IMPORT_C static CPanoramaTransform* NewL();
1.86 +
1.87 + IMPORT_C void GetTranslation(TPoint& aDxDy, TSize& aDims) const;
1.88 + IMPORT_C void SetTranslationL(const TPoint& aDxDy, const TSize& aDims);
1.89 + IMPORT_C void GetDirection(TDirection& aDirection);
1.90 + IMPORT_C void GetDirection(TDirection& aDirection, TInt& aMinimumDelta);
1.91 + IMPORT_C void SetDirection(TDirection& aDirection);
1.92 + IMPORT_C void SetDirection(TDirection& aDirection, TInt aMinDelta);
1.93 +
1.94 + IMPORT_C ~CPanoramaTransform();
1.95 +
1.96 +private:
1.97 + CPanoramaTransform();
1.98 + void ConstructL();
1.99 +
1.100 +private:
1.101 + CPanoramaTransformImpl* iPanTransImpl;
1.102 + };
1.103 +
1.104 +/**
1.105 +This class provides functions to register the image that has got from viewfinder
1.106 +and checks the appropriate time to capture that image.
1.107 +*/
1.108 +class CVFTracker : public CBase
1.109 + {
1.110 +public:
1.111 + IMPORT_C static CVFTracker* NewL();
1.112 +
1.113 + IMPORT_C void RegisterImageL(const CFbsBitmap& aBitmap, CPanoramaTransform& aPanTrans);
1.114 + IMPORT_C void RegisterImageL(const CImageFrame& aImageFrame, CPanoramaTransform& aPanTrans);
1.115 + IMPORT_C TBool IsTimeToCapture(TDirection& aDirection) const;
1.116 + IMPORT_C TBool IsTimeToCapture(TDirection& aDirection, TInt aOverlap) const;
1.117 + IMPORT_C void Reset();
1.118 + IMPORT_C void InitializeL(const TSize& aSize);
1.119 +
1.120 + IMPORT_C TAny* Extension(TUid aExtension);
1.121 +
1.122 + IMPORT_C ~CVFTracker();
1.123 +
1.124 +private:
1.125 + CVFTracker();
1.126 + void ConstructL();
1.127 +
1.128 +private:
1.129 + CVFTrackerImpl* iVFTrackImpl;
1.130 + };
1.131 +
1.132 +/**
1.133 +This class provides functions to get basic stitching. Input can be a file,
1.134 +descriptor, bitmap, imageframe.
1.135 +*/
1.136 +class CImagePanorama : public CBase
1.137 + {
1.138 +public:
1.139 + IMPORT_C static CImagePanorama* NewL();
1.140 +
1.141 + IMPORT_C void AddFileL(const TDesC& aFilename, CPanoramaTransform& aPanTrans);
1.142 + IMPORT_C void AddBufferL(const TDesC8& aData, CPanoramaTransform& aPanTrans);
1.143 + IMPORT_C void AddImageL(const CFbsBitmap& aBitmap, CPanoramaTransform& aPanTrans);
1.144 + IMPORT_C void AddImageL(const CImageFrame& aImageFrame, CPanoramaTransform& aPanTrans);
1.145 +
1.146 + IMPORT_C void CurrentImageSizeL(TSize& aSize);
1.147 +
1.148 + IMPORT_C void RenderL(const TDesC& aFilename);
1.149 + IMPORT_C void RenderL(const TDesC& aFilename, const TSize& aSize, const TBool aMaintainAspectRatio, const TUid& aImageTypeUid);
1.150 +
1.151 + IMPORT_C void RenderL(RFile& aFile);
1.152 + IMPORT_C void RenderL(RFile& aFile, const TSize& aSize, const TBool aMaintainAspectRatio, const TUid& aImageTypeUid);
1.153 +
1.154 + IMPORT_C void RenderL(HBufC8*& aDestData);
1.155 + IMPORT_C void RenderL(HBufC8*& aDestData, TUint32 aMaxBufferSize, const TSize& aSize, const TBool aMaintainAspectRatio, const TUid& aImageTypeUid);
1.156 +
1.157 + IMPORT_C void RenderL(const CFbsBitmap& aBitmap);
1.158 + IMPORT_C void RenderL(const CFbsBitmap& aBitmap, const TBool aMaintainAspectRatio);
1.159 +
1.160 + IMPORT_C void RenderL(const CImageFrame& aImageFrame);
1.161 + IMPORT_C void RenderL(const CImageFrame& aImageFrame, const TBool aMaintainAspectRatio);
1.162 +
1.163 + IMPORT_C void InitializeL(const TSize & aSize, const TPanoramaLens& aPanoramaLens, const TDirection& aDirection);
1.164 +
1.165 + IMPORT_C TAny* Extension(TUid aExtension);
1.166 +
1.167 + IMPORT_C ~CImagePanorama();
1.168 +
1.169 +private:
1.170 + CImagePanorama();
1.171 + void ConstructL();
1.172 +
1.173 +private:
1.174 + CImagePanoramaImpl* iImgPanImpl;
1.175 + };
1.176 +
1.177 +#endif //PANORAMA_H