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