os/mm/mmplugins/cameraplugins/source/testcamera/test_snapshot.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmplugins/cameraplugins/source/testcamera/test_snapshot.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,95 @@
     1.4 +// Copyright (c) 2007-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 +// testsnapshot.h
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#ifndef TESTSNAPSHOT_H
    1.22 +#define TESTSNAPSHOT_H
    1.23 +
    1.24 +#include "TestCamera.h"
    1.25 +#include <ecam/mcamerasnapshot.h>
    1.26 +
    1.27 +const TInt KNumOfSnapshotExtensions = 1;
    1.28 +
    1.29 +// Implementations of the MCameraSnapshot class
    1.30 +class CTestCamSnapshot : 	public CBase, 
    1.31 +							public MCameraSnapshot
    1.32 +	{
    1.33 +	friend class CTestCamera;
    1.34 +public:
    1.35 +	static CTestCamSnapshot* NewL(CTestCamera& aOwner);
    1.36 +	~CTestCamSnapshot();
    1.37 +	
    1.38 +private:
    1.39 +	void Release();
    1.40 +	
    1.41 +	//from MCameraSnapshot
    1.42 +	TUint32 SupportedFormats();
    1.43 +	
    1.44 +    void PrepareSnapshotL(CCamera::TFormat aFormat, const TPoint& aPosition, const TSize& aSize, const TRgb& aBgColor, TBool aMaintainAspectRatio);
    1.45 +    
    1.46 +	void PrepareSnapshotL(CCamera::TFormat aFormat, const TSize& aSize, TBool aMaintainAspectRatio);
    1.47 +	
    1.48 +	void SetBgColorL(const TRgb& aBgColor); 
    1.49 +	
    1.50 +	void SetPositionL(const TPoint& aPosition);
    1.51 +	
    1.52 +    TBool IsSnapshotActive() const;
    1.53 +
    1.54 +    void StartSnapshot();
    1.55 +
    1.56 +	void StopSnapshot();
    1.57 +        	
    1.58 +	MCameraBuffer& SnapshotDataL(RArray<TInt>& aFrameIndexOrder);
    1.59 +	
    1.60 +	// New functions
    1.61 +	void ServiceSnapshot(const CFbsBitGc& aSourceBitmapGc);
    1.62 +	void ServiceBurstImageSnapshot(const CFbsBitGc& aSourceBitmapGc);
    1.63 +
    1.64 +private:
    1.65 +	CTestCamSnapshot(CTestCamera& aOwner);
    1.66 +	void Init();
    1.67 +	void ConstructL();
    1.68 +	void DoStartSnapshotL();
    1.69 +	
    1.70 +private:
    1.71 +	CTestCamera& iOwner;
    1.72 +	
    1.73 +	TInt iRefCount;
    1.74 +			
    1.75 +	CFbsBitmap* iSnapshot;
    1.76 +	CFbsBitmapDevice* iSnapshotDev;
    1.77 +	CFbsBitGc* iSnapshotGc;
    1.78 +	
    1.79 +	CFbsBitmap* iSnapshotImage;
    1.80 +	CFbsBitmapDevice* iSnapshotImageDev;
    1.81 +	CFbsBitGc* iSnapshotImageGc;
    1.82 +	
    1.83 +	TRect iSnapshotImageRect;
    1.84 +	CCamera::TFormat iSnapshotFormat;
    1.85 +	TRgb iBgColor;
    1.86 +	
    1.87 +	TUint32 iImageFormatsSupported;
    1.88 +	
    1.89 +	RArray<TRect> iSupportedSnapshotRect;
    1.90 +	
    1.91 +	RTestCameraFrameBuffer iSnapshotBuffer;
    1.92 +	
    1.93 +	volatile TBool iSnapshotPrepared;
    1.94 +	volatile TBool iSnapshotActive;
    1.95 +		
    1.96 +	};
    1.97 +	
    1.98 +#endif // TESTSNAPSHOT_H