sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // testsnapshot.h sl@0: // sl@0: // sl@0: sl@0: #ifndef TESTSNAPSHOT_H sl@0: #define TESTSNAPSHOT_H sl@0: sl@0: #include "TestCamera.h" sl@0: #include sl@0: sl@0: const TInt KNumOfSnapshotExtensions = 1; sl@0: sl@0: // Implementations of the MCameraSnapshot class sl@0: class CTestCamSnapshot : public CBase, sl@0: public MCameraSnapshot sl@0: { sl@0: friend class CTestCamera; sl@0: public: sl@0: static CTestCamSnapshot* NewL(CTestCamera& aOwner); sl@0: ~CTestCamSnapshot(); sl@0: sl@0: private: sl@0: void Release(); sl@0: sl@0: //from MCameraSnapshot sl@0: TUint32 SupportedFormats(); sl@0: sl@0: void PrepareSnapshotL(CCamera::TFormat aFormat, const TPoint& aPosition, const TSize& aSize, const TRgb& aBgColor, TBool aMaintainAspectRatio); sl@0: sl@0: void PrepareSnapshotL(CCamera::TFormat aFormat, const TSize& aSize, TBool aMaintainAspectRatio); sl@0: sl@0: void SetBgColorL(const TRgb& aBgColor); sl@0: sl@0: void SetPositionL(const TPoint& aPosition); sl@0: sl@0: TBool IsSnapshotActive() const; sl@0: sl@0: void StartSnapshot(); sl@0: sl@0: void StopSnapshot(); sl@0: sl@0: MCameraBuffer& SnapshotDataL(RArray& aFrameIndexOrder); sl@0: sl@0: // New functions sl@0: void ServiceSnapshot(const CFbsBitGc& aSourceBitmapGc); sl@0: void ServiceBurstImageSnapshot(const CFbsBitGc& aSourceBitmapGc); sl@0: sl@0: private: sl@0: CTestCamSnapshot(CTestCamera& aOwner); sl@0: void Init(); sl@0: void ConstructL(); sl@0: void DoStartSnapshotL(); sl@0: sl@0: private: sl@0: CTestCamera& iOwner; sl@0: sl@0: TInt iRefCount; sl@0: sl@0: CFbsBitmap* iSnapshot; sl@0: CFbsBitmapDevice* iSnapshotDev; sl@0: CFbsBitGc* iSnapshotGc; sl@0: sl@0: CFbsBitmap* iSnapshotImage; sl@0: CFbsBitmapDevice* iSnapshotImageDev; sl@0: CFbsBitGc* iSnapshotImageGc; sl@0: sl@0: TRect iSnapshotImageRect; sl@0: CCamera::TFormat iSnapshotFormat; sl@0: TRgb iBgColor; sl@0: sl@0: TUint32 iImageFormatsSupported; sl@0: sl@0: RArray iSupportedSnapshotRect; sl@0: sl@0: RTestCameraFrameBuffer iSnapshotBuffer; sl@0: sl@0: volatile TBool iSnapshotPrepared; sl@0: volatile TBool iSnapshotActive; sl@0: sl@0: }; sl@0: sl@0: #endif // TESTSNAPSHOT_H