epoc32/include/imageprocessor/imageprocessorpreview.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     2
// All rights reserved.
williamr@4
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@4
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@4
     7
//
williamr@4
     8
// Initial Contributors:
williamr@4
     9
// Nokia Corporation - initial contribution.
williamr@4
    10
//
williamr@4
    11
// Contributors:
williamr@4
    12
//
williamr@4
    13
// Description:
williamr@4
    14
//
williamr@4
    15
williamr@4
    16
/**
williamr@4
    17
 @file
williamr@4
    18
 @publishedAll 
williamr@4
    19
 @released 
williamr@4
    20
*/
williamr@4
    21
williamr@4
    22
#ifndef __IMAGE_PROCESSOR_PREVIEW_H__
williamr@4
    23
#define __IMAGE_PROCESSOR_PREVIEW_H__
williamr@4
    24
williamr@4
    25
#include <e32base.h>
williamr@4
    26
#include <gdi.h>
williamr@4
    27
#include <imageframe.h>
williamr@4
    28
williamr@4
    29
class CFbsBitmap;
williamr@4
    30
class CImageFrame;
williamr@4
    31
williamr@4
    32
namespace ImageProcessor
williamr@4
    33
	{
williamr@4
    34
williamr@4
    35
class CImageProcessorImpl;
williamr@4
    36
williamr@4
    37
namespace Plugin
williamr@4
    38
	{
williamr@4
    39
	class MPreview;
williamr@4
    40
	}
williamr@4
    41
williamr@4
    42
/**
williamr@4
    43
A preview representation of the rendered image after effects and geometric operations have been applied. Has the ability to zoom and pan the output image in the 
williamr@4
    44
supplied pixel buffer. Typically this is a low resolution representation of the image which allows effects and operations
williamr@4
    45
to be applied quickly to the image without needing to process the whole image.
williamr@4
    46
williamr@4
    47
@publishedAll
williamr@4
    48
@released
williamr@4
    49
*/
williamr@4
    50
class TPreview
williamr@4
    51
	{
williamr@4
    52
public:
williamr@4
    53
	/**
williamr@4
    54
	The state of the preview screen
williamr@4
    55
	*/
williamr@4
    56
	enum TState 
williamr@4
    57
		{
williamr@4
    58
		/** State means the preview has not been initialized, need to call InitializeL() to initialize*/
williamr@4
    59
		EUninitialized,
williamr@4
    60
		/** State means the preview is being initialized by async call of InitializeL()*/
williamr@4
    61
		EInitializing,
williamr@4
    62
		/** State means the initialize process has finished and preview is available to be rendered*/
williamr@4
    63
		EInitialized,
williamr@4
    64
		/** State means the preview is being rendered by async call of RenderL()*/
williamr@4
    65
		ERendering,
williamr@4
    66
williamr@4
    67
        /** Count of valid preview states (boundary marker - not a true state). */
williamr@4
    68
		EStatesCount
williamr@4
    69
		};
williamr@4
    70
williamr@4
    71
public:
williamr@4
    72
	IMPORT_C void SupportedImageFrameFormatsL(RArray<TUid>& aFormats) const;
williamr@4
    73
	IMPORT_C void SupportedOutputDisplayModesL(RArray<TDisplayMode>& aDisplayModes) const;
williamr@4
    74
	
williamr@4
    75
	IMPORT_C void SetOutputL(CFbsBitmap& aBitmap);
williamr@4
    76
	IMPORT_C void SetOutputL(CImageFrame& aPixelBuffer);
williamr@4
    77
	
williamr@4
    78
	IMPORT_C CImageFrame* CreateOutputL(const TSize &aFrameSize, const TFrameFormatBase &aFrameFormat, const TFrameLayoutBase &aFrameLayout);
williamr@4
    79
williamr@4
    80
	IMPORT_C void InitializeL();
williamr@4
    81
	IMPORT_C void UninitializeL();
williamr@4
    82
williamr@4
    83
	IMPORT_C void RenderL();
williamr@4
    84
	IMPORT_C void ResetL();
williamr@4
    85
	IMPORT_C void Cancel();
williamr@4
    86
		
williamr@4
    87
	IMPORT_C void SetZoomL(TReal32 aZoom);
williamr@4
    88
	IMPORT_C void SetPanL(TReal32 aPanX, TReal32 aPanY);
williamr@4
    89
	IMPORT_C void SetPreviewId(TInt aPreviewId);
williamr@4
    90
	IMPORT_C void GetZoomLevelSettings(TReal32& aMinimumLevel, TReal32& aMaximumLevel);
williamr@4
    91
	IMPORT_C void GetPanLevelSettings(TReal32& aMinimumLevel, TReal32& aMaximumLevel);
williamr@4
    92
		
williamr@4
    93
	IMPORT_C TReal32 ZoomL() const;
williamr@4
    94
	IMPORT_C void PanL(TReal32& aPanX, TReal32& aPanY) const;
williamr@4
    95
	IMPORT_C TSize SizeL() const;
williamr@4
    96
	IMPORT_C TRect CanvasAreaL() const;
williamr@4
    97
	IMPORT_C TInt PreviewId() const;
williamr@4
    98
	
williamr@4
    99
	IMPORT_C void PreviewToCurrentCoordL(const TPoint& aPreviewPoint, TPoint& aCurrentPoint) const;
williamr@4
   100
	IMPORT_C void CanvasToCurrentCoordL(const TPoint& aCanvasPoint, TPoint& aCurrentPoint) const;
williamr@4
   101
williamr@4
   102
	IMPORT_C TPreview::TState State() const;
williamr@4
   103
williamr@4
   104
private:
williamr@4
   105
	friend class CImageProcessorImpl;
williamr@4
   106
	CImageProcessorImpl& iImageProcessorImpl;
williamr@4
   107
	TPreview(Plugin::MPreview& aPreviewImpl, CImageProcessorImpl& aImageProcessorImpl);
williamr@4
   108
williamr@4
   109
	void SetStateL(TPreview::TState aState);
williamr@4
   110
williamr@4
   111
	static const TBool iValidStates[TPreview::EStatesCount][TPreview::EStatesCount];
williamr@4
   112
	Plugin::MPreview& iPreviewImpl;
williamr@4
   113
	
williamr@4
   114
	TPreview::TState iState;
williamr@4
   115
	TBool iIsOutputSet;
williamr@4
   116
	TInt iReserved; // future proof
williamr@4
   117
	};
williamr@4
   118
williamr@4
   119
	} //namespace ImageProcessor
williamr@4
   120
williamr@4
   121
#endif //__IMAGE_PROCESSOR_PREVIEW_H__