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