os/mm/imagingandcamerafws/cameraunittest/src/ECamUnitTestPlugin/EnhanceFunctionality.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/imagingandcamerafws/cameraunittest/src/ECamUnitTestPlugin/EnhanceFunctionality.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,206 @@
1.4 +// Copyright (c) 2005-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 +#ifndef ENHANCEFUNCTIONALITY_H
1.20 +#define ENHANCEFUNCTIONALITY_H
1.21 +
1.22 +#include <ecam/ecamplugin.h>
1.23 +#include <ecam/ecaminfoplugin.h>
1.24 +
1.25 +#include "ECamUnitTestPlugin.h"
1.26 +#include <fbs.h>
1.27 +
1.28 +#include <ecam/mcamerahistogram.h>
1.29 +#include <ecam/mcameraoverlay.h>
1.30 +#include <ecam/mcamerasnapshot.h>
1.31 +
1.32 +
1.33 +
1.34 +class CCamUnitTestPlugin;
1.35 +
1.36 +class CCamHistogram : public CBase, public MCameraHistogram
1.37 + {
1.38 + class CHistogram;
1.39 +public:
1.40 + static CCamHistogram* NewL(CCamUnitTestPlugin& aOwner);
1.41 + ~CCamHistogram();
1.42 + TUint32 SupportedHistograms();
1.43 + TUint PrepareHistogramL(CCamera::CCameraHistogram::THistogramType aType);
1.44 + TUint PrepareDSAHistogramL(CCamera::CCameraHistogram::THistogramType aType, const TPoint& aPosition, const TSize& aSize, const TRgb& aColor);
1.45 + void StartHistogramL(TUint aHistHandle);
1.46 + void StopHistogramL(TUint aHistHandle);
1.47 + void DestroyHistogramL(TUint aHistHandle);
1.48 + void Release();
1.49 + void GetActiveHistogramsL(RArray<TUint>& aActiveHistograms);
1.50 + void UpdateDSAHistogramPropertiesL(TUint aHistHandle, const TPoint& aPosition, const TSize& aSize, const TRgb& aColor);
1.51 + void GetDSAHistogramPropertiesL(TUint aHistHandle, TPoint& aPosition, TSize& aSize, TRgb& aColor);
1.52 + MHistogramBuffer& HistogramDataL();
1.53 + MHistogramBuffer& HistogramDataL(TUint aHistHandle);
1.54 +
1.55 + void ConstructL();
1.56 +
1.57 +private:
1.58 + CCamHistogram(CCamUnitTestPlugin& aOwner);
1.59 +
1.60 +
1.61 +private:
1.62 + CCamUnitTestPlugin& iOwner;
1.63 +
1.64 + TBool iHistActive;
1.65 + TBool iDSAHistActive;
1.66 +
1.67 + TInt iHistogramCount;
1.68 + CArrayFixFlat<CHistogram*>* iHistograms;
1.69 +
1.70 + HBufC* iHistData;
1.71 + };
1.72 +
1.73 +
1.74 +class CCamHistogram::CHistogram : public CBase
1.75 + {
1.76 +public:
1.77 + static CHistogram* NewL(TBool aDSA, CCamera::CCameraHistogram::THistogramType aType, TPoint aPosition, TSize aSize, TRgb iColor);
1.78 +
1.79 +public:
1.80 + CHistogram(TBool aDSA, CCamera::CCameraHistogram::THistogramType aType, TPoint aPosition, TSize aSize, TRgb iColor);
1.81 + ~CHistogram ();
1.82 +
1.83 + TBool IsActive();
1.84 +
1.85 +public:
1.86 + TBool iDSA;
1.87 + CCamera::CCameraHistogram::THistogramType iType;
1.88 + TInt iAlpha;
1.89 + TPoint iPosition;
1.90 + TSize iSize;
1.91 + TRgb iColor;
1.92 +
1.93 + TBool iActive; // ETrue is StartHistogramL has been called
1.94 +
1.95 + };
1.96 +
1.97 +// For Snapshot
1.98 +class CCamSnapshot : public CBase, public MCameraSnapshot
1.99 + {
1.100 +public:
1.101 + static CCamSnapshot* NewL(CCamUnitTestPlugin& aOwner);
1.102 + ~CCamSnapshot();
1.103 +
1.104 + TUint32 SupportedFormats();
1.105 + void PrepareSnapshotL(CCamera::TFormat aFormat, const TPoint& aPosition, const TSize& aSize, const TRgb& aBgColor, TBool aMaintainAspectRatio);
1.106 + void PrepareSnapshotL(CCamera::TFormat aFormat, const TSize& aSize, TBool aMaintainAspectRatio);
1.107 +
1.108 + void SetBgColorL(const TRgb& aBgColor);
1.109 + void SetPositionL(const TPoint& aPosition);
1.110 +
1.111 + TBool IsSnapshotActive() const;
1.112 + void StartSnapshot();
1.113 + void StopSnapshot();
1.114 + MCameraBuffer& SnapshotDataL(RArray<TInt>& aFrameIndexOrder);
1.115 + void Release();
1.116 +
1.117 +private:
1.118 + CCamSnapshot(CCamUnitTestPlugin& aOwner);
1.119 +
1.120 +private:
1.121 + CCamUnitTestPlugin& iOwner;
1.122 +
1.123 + CCamera::TFormat iFormat;
1.124 + TSize iSize;
1.125 + TRgb iBgColor;
1.126 + TBool iAspRatio;
1.127 + TPoint iPos;
1.128 + TBool iActive; // ETrue is StartHistogramL has been called
1.129 + };
1.130 +
1.131 +
1.132 +//For Overlay
1.133 +class CCamOverlay : public CBase, public MCameraOverlay, public MCameraOverlay2
1.134 + {
1.135 + class COverlay;
1.136 +public:
1.137 + static CCamOverlay* NewL(CCamUnitTestPlugin& aOwner);
1.138 + ~CCamOverlay();
1.139 +
1.140 + void ConstructL();
1.141 +
1.142 + //from MCameraOverlay
1.143 + TUint CreateOverlayL(const CCamera::CCameraOverlay::TOverlayParameters& aParameters, CFbsBitmap* aBitmap);
1.144 + void SetOverlayBitmapL(TUint aOverlayHandleRef, const CFbsBitmap* aBitmap);
1.145 + void GetOverlayBitmapL(TUint aOverlayHandleRef, CFbsBitmap* aBitmap);
1.146 + void GetOverlayParametersL(TUint aOverlayHandle, CCamera::CCameraOverlay::TOverlayParameters& aInfo);
1.147 + void SetOverlayParametersL(TUint aOverlayHandle, const CCamera::CCameraOverlay::TOverlayParameters& aParameters);
1.148 + void ReleaseOverlay(TUint aOverlayHandleRef);
1.149 + void Release();
1.150 + void GetOverlaySupport(CCamera::CCameraOverlay::TOverlaySupportInfo& aInfo);
1.151 + void GetAllOverlaysInZOrderL(RArray<TUint>& aOverlayHandles);
1.152 + void SetAllOverlaysInZOrderL(const RArray<TUint>& aOverlayHandles);
1.153 +
1.154 + //from MCameraOverlay2
1.155 + void SetModifiableOverlayBitmapL(TUint aOverlayHandle, CFbsBitmap* aBitmap);
1.156 + void GetAllOverlaysInZOrderL(CCamera::CCameraOverlay::TOverlayCameraMode aOverlayCameraMode, TInt aViewFinderHandle, RArray<TUint>& aOverlayHandles) const;
1.157 + void SetAllOverlaysInZOrderL(CCamera::CCameraOverlay::TOverlayCameraMode aOverlayCameraMode, TInt aViewFinderHandle, const RArray<TUint>& aOverlayHandles);
1.158 +
1.159 +private:
1.160 + CCamOverlay(CCamUnitTestPlugin& aOwner);
1.161 +
1.162 +public:
1.163 + TInt iRefCount;
1.164 +
1.165 +private:
1.166 + CCamUnitTestPlugin& iOwner;
1.167 + CArrayFixFlat<COverlay*>* iOverlays;
1.168 +
1.169 + CCamera::CCameraOverlay::TOverlaySupportInfo iSupportInfo;
1.170 + };
1.171 +
1.172 +class CCamOverlay::COverlay : public CBase
1.173 + {
1.174 +public:
1.175 + static COverlay* NewL(const CCamera::CCameraOverlay::TOverlayParameters& aParameters, CFbsBitmap* aBitmap);
1.176 +
1.177 +public:
1.178 + ~COverlay ();
1.179 + void ConstructL();
1.180 +
1.181 +private:
1.182 + COverlay(const CCamera::CCameraOverlay::TOverlayParameters& aParameters, CFbsBitmap* aBitmap);
1.183 +
1.184 +public:
1.185 + CCamera::CCameraOverlay::TOverlayParameters iOverlayParms;
1.186 + CFbsBitmap* iBitmap; // doesn't own
1.187 + TUint iZOrderReverse; //for sorting on z-order
1.188 + };
1.189 +
1.190 +
1.191 +class RCamSnapshotBuffer : public MCameraBuffer
1.192 + {
1.193 +public:
1.194 + RCamSnapshotBuffer(CFbsBitmap*& aFrame): iAvailable(ETrue), iFrame(aFrame) {}
1.195 + virtual TInt NumFrames() {return 0;}
1.196 + virtual TDesC8* DataL(TInt aFrameIndex) {if (aFrameIndex != 0) { User::Leave(KErrArgument); } return NULL; }
1.197 + virtual CFbsBitmap& BitmapL(TInt aFrameIndex) {if (aFrameIndex != 0) { User::Leave(KErrArgument); } return *iFrame;}
1.198 + virtual RChunk& ChunkL() { return iChunk;}
1.199 + virtual TInt ChunkOffsetL(TInt aFrameIndex) {if (aFrameIndex != 0) { User::Leave(KErrArgument); } return 0;}
1.200 + virtual TInt FrameSize(TInt aFrameIndex) {if (aFrameIndex != 0) { User::Leave(KErrArgument); } return 0; }
1.201 + virtual void Release() {iAvailable = ETrue;}
1.202 +
1.203 +public:
1.204 + TBool iAvailable;
1.205 + CFbsBitmap*& iFrame;
1.206 + RChunk iChunk;
1.207 + };
1.208 +
1.209 +#endif // ENHANCEFUNCTIONALITY_H