mmplugins/cameraplugins/source/testcamera/test_snapshot.h
author Shimizu Satoshi <s_shimizu@isb.co.jp>
Tue, 19 Oct 2010 11:48:59 +0900
branchRCL_3
changeset 64 92a82bc706f7
parent 0 40261b775718
permissions -rw-r--r--
Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
64
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
     2
// All rights reserved.
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
     3
// This component and the accompanying materials are made available
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
     4
// under the terms of the License "Symbian Foundation License v1.0"
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
     5
// which accompanies this distribution, and is available
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
     6
// at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
     7
//
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
     8
// Initial Contributors:
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
     9
// Nokia Corporation - initial contribution.
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    10
//
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    11
// Contributors:
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    12
//
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    13
// Description:
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    14
// testsnapshot.h
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    15
// 
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    16
//
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    17
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    18
#ifndef TESTSNAPSHOT_H
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    19
#define TESTSNAPSHOT_H
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    20
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    21
#include "TestCamera.h"
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    22
#include <ecam/mcamerasnapshot.h>
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    23
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    24
const TInt KNumOfSnapshotExtensions = 1;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    25
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    26
// Implementations of the MCameraSnapshot class
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    27
class CTestCamSnapshot : 	public CBase, 
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    28
							public MCameraSnapshot
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    29
	{
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    30
	friend class CTestCamera;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    31
public:
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    32
	static CTestCamSnapshot* NewL(CTestCamera& aOwner);
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    33
	~CTestCamSnapshot();
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    34
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    35
private:
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    36
	void Release();
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    37
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    38
	//from MCameraSnapshot
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    39
	TUint32 SupportedFormats();
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    40
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    41
    void PrepareSnapshotL(CCamera::TFormat aFormat, const TPoint& aPosition, const TSize& aSize, const TRgb& aBgColor, TBool aMaintainAspectRatio);
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    42
    
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    43
	void PrepareSnapshotL(CCamera::TFormat aFormat, const TSize& aSize, TBool aMaintainAspectRatio);
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    44
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    45
	void SetBgColorL(const TRgb& aBgColor); 
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    46
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    47
	void SetPositionL(const TPoint& aPosition);
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    48
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    49
    TBool IsSnapshotActive() const;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    50
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    51
    void StartSnapshot();
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    52
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    53
	void StopSnapshot();
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    54
        	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    55
	MCameraBuffer& SnapshotDataL(RArray<TInt>& aFrameIndexOrder);
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    56
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    57
	// New functions
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    58
	void ServiceSnapshot(const CFbsBitGc& aSourceBitmapGc);
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    59
	void ServiceBurstImageSnapshot(const CFbsBitGc& aSourceBitmapGc);
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    60
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    61
private:
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    62
	CTestCamSnapshot(CTestCamera& aOwner);
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    63
	void Init();
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    64
	void ConstructL();
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    65
	void DoStartSnapshotL();
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    66
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    67
private:
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    68
	CTestCamera& iOwner;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    69
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    70
	TInt iRefCount;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    71
			
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    72
	CFbsBitmap* iSnapshot;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    73
	CFbsBitmapDevice* iSnapshotDev;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    74
	CFbsBitGc* iSnapshotGc;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    75
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    76
	CFbsBitmap* iSnapshotImage;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    77
	CFbsBitmapDevice* iSnapshotImageDev;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    78
	CFbsBitGc* iSnapshotImageGc;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    79
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    80
	TRect iSnapshotImageRect;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    81
	CCamera::TFormat iSnapshotFormat;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    82
	TRgb iBgColor;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    83
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    84
	TUint32 iImageFormatsSupported;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    85
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    86
	RArray<TRect> iSupportedSnapshotRect;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    87
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    88
	RTestCameraFrameBuffer iSnapshotBuffer;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    89
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    90
	volatile TBool iSnapshotPrepared;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    91
	volatile TBool iSnapshotActive;
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    92
		
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    93
	};
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    94
	
92a82bc706f7 Obtain an image of Webcamera from QEMU and add the Bitmap change display function.
Shimizu Satoshi <s_shimizu@isb.co.jp>
parents: 0
diff changeset
    95
#endif // TESTSNAPSHOT_H