os/mm/imagingandcamerafws/cameraunittest/src/ECamUnitTestPlugin/EnhanceFunctionality.h
Update contrib.
1 // Copyright (c) 2005-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.
16 #ifndef ENHANCEFUNCTIONALITY_H
17 #define ENHANCEFUNCTIONALITY_H
19 #include <ecam/ecamplugin.h>
20 #include <ecam/ecaminfoplugin.h>
22 #include "ECamUnitTestPlugin.h"
25 #include <ecam/mcamerahistogram.h>
26 #include <ecam/mcameraoverlay.h>
27 #include <ecam/mcamerasnapshot.h>
31 class CCamUnitTestPlugin;
33 class CCamHistogram : public CBase, public MCameraHistogram
37 static CCamHistogram* NewL(CCamUnitTestPlugin& aOwner);
39 TUint32 SupportedHistograms();
40 TUint PrepareHistogramL(CCamera::CCameraHistogram::THistogramType aType);
41 TUint PrepareDSAHistogramL(CCamera::CCameraHistogram::THistogramType aType, const TPoint& aPosition, const TSize& aSize, const TRgb& aColor);
42 void StartHistogramL(TUint aHistHandle);
43 void StopHistogramL(TUint aHistHandle);
44 void DestroyHistogramL(TUint aHistHandle);
46 void GetActiveHistogramsL(RArray<TUint>& aActiveHistograms);
47 void UpdateDSAHistogramPropertiesL(TUint aHistHandle, const TPoint& aPosition, const TSize& aSize, const TRgb& aColor);
48 void GetDSAHistogramPropertiesL(TUint aHistHandle, TPoint& aPosition, TSize& aSize, TRgb& aColor);
49 MHistogramBuffer& HistogramDataL();
50 MHistogramBuffer& HistogramDataL(TUint aHistHandle);
55 CCamHistogram(CCamUnitTestPlugin& aOwner);
59 CCamUnitTestPlugin& iOwner;
65 CArrayFixFlat<CHistogram*>* iHistograms;
71 class CCamHistogram::CHistogram : public CBase
74 static CHistogram* NewL(TBool aDSA, CCamera::CCameraHistogram::THistogramType aType, TPoint aPosition, TSize aSize, TRgb iColor);
77 CHistogram(TBool aDSA, CCamera::CCameraHistogram::THistogramType aType, TPoint aPosition, TSize aSize, TRgb iColor);
84 CCamera::CCameraHistogram::THistogramType iType;
90 TBool iActive; // ETrue is StartHistogramL has been called
95 class CCamSnapshot : public CBase, public MCameraSnapshot
98 static CCamSnapshot* NewL(CCamUnitTestPlugin& aOwner);
101 TUint32 SupportedFormats();
102 void PrepareSnapshotL(CCamera::TFormat aFormat, const TPoint& aPosition, const TSize& aSize, const TRgb& aBgColor, TBool aMaintainAspectRatio);
103 void PrepareSnapshotL(CCamera::TFormat aFormat, const TSize& aSize, TBool aMaintainAspectRatio);
105 void SetBgColorL(const TRgb& aBgColor);
106 void SetPositionL(const TPoint& aPosition);
108 TBool IsSnapshotActive() const;
109 void StartSnapshot();
111 MCameraBuffer& SnapshotDataL(RArray<TInt>& aFrameIndexOrder);
115 CCamSnapshot(CCamUnitTestPlugin& aOwner);
118 CCamUnitTestPlugin& iOwner;
120 CCamera::TFormat iFormat;
125 TBool iActive; // ETrue is StartHistogramL has been called
130 class CCamOverlay : public CBase, public MCameraOverlay, public MCameraOverlay2
134 static CCamOverlay* NewL(CCamUnitTestPlugin& aOwner);
139 //from MCameraOverlay
140 TUint CreateOverlayL(const CCamera::CCameraOverlay::TOverlayParameters& aParameters, CFbsBitmap* aBitmap);
141 void SetOverlayBitmapL(TUint aOverlayHandleRef, const CFbsBitmap* aBitmap);
142 void GetOverlayBitmapL(TUint aOverlayHandleRef, CFbsBitmap* aBitmap);
143 void GetOverlayParametersL(TUint aOverlayHandle, CCamera::CCameraOverlay::TOverlayParameters& aInfo);
144 void SetOverlayParametersL(TUint aOverlayHandle, const CCamera::CCameraOverlay::TOverlayParameters& aParameters);
145 void ReleaseOverlay(TUint aOverlayHandleRef);
147 void GetOverlaySupport(CCamera::CCameraOverlay::TOverlaySupportInfo& aInfo);
148 void GetAllOverlaysInZOrderL(RArray<TUint>& aOverlayHandles);
149 void SetAllOverlaysInZOrderL(const RArray<TUint>& aOverlayHandles);
151 //from MCameraOverlay2
152 void SetModifiableOverlayBitmapL(TUint aOverlayHandle, CFbsBitmap* aBitmap);
153 void GetAllOverlaysInZOrderL(CCamera::CCameraOverlay::TOverlayCameraMode aOverlayCameraMode, TInt aViewFinderHandle, RArray<TUint>& aOverlayHandles) const;
154 void SetAllOverlaysInZOrderL(CCamera::CCameraOverlay::TOverlayCameraMode aOverlayCameraMode, TInt aViewFinderHandle, const RArray<TUint>& aOverlayHandles);
157 CCamOverlay(CCamUnitTestPlugin& aOwner);
163 CCamUnitTestPlugin& iOwner;
164 CArrayFixFlat<COverlay*>* iOverlays;
166 CCamera::CCameraOverlay::TOverlaySupportInfo iSupportInfo;
169 class CCamOverlay::COverlay : public CBase
172 static COverlay* NewL(const CCamera::CCameraOverlay::TOverlayParameters& aParameters, CFbsBitmap* aBitmap);
179 COverlay(const CCamera::CCameraOverlay::TOverlayParameters& aParameters, CFbsBitmap* aBitmap);
182 CCamera::CCameraOverlay::TOverlayParameters iOverlayParms;
183 CFbsBitmap* iBitmap; // doesn't own
184 TUint iZOrderReverse; //for sorting on z-order
188 class RCamSnapshotBuffer : public MCameraBuffer
191 RCamSnapshotBuffer(CFbsBitmap*& aFrame): iAvailable(ETrue), iFrame(aFrame) {}
192 virtual TInt NumFrames() {return 0;}
193 virtual TDesC8* DataL(TInt aFrameIndex) {if (aFrameIndex != 0) { User::Leave(KErrArgument); } return NULL; }
194 virtual CFbsBitmap& BitmapL(TInt aFrameIndex) {if (aFrameIndex != 0) { User::Leave(KErrArgument); } return *iFrame;}
195 virtual RChunk& ChunkL() { return iChunk;}
196 virtual TInt ChunkOffsetL(TInt aFrameIndex) {if (aFrameIndex != 0) { User::Leave(KErrArgument); } return 0;}
197 virtual TInt FrameSize(TInt aFrameIndex) {if (aFrameIndex != 0) { User::Leave(KErrArgument); } return 0; }
198 virtual void Release() {iAvailable = ETrue;}
206 #endif // ENHANCEFUNCTIONALITY_H