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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
22 #ifndef __IMAGE_PROCESSOR_PREVIEW_H__
23 #define __IMAGE_PROCESSOR_PREVIEW_H__
27 #include <imageframe.h>
32 namespace ImageProcessor
35 class CImageProcessorImpl;
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.
54 The state of the preview screen
58 /** State means the preview has not been initialized, need to call InitializeL() to initialize*/
60 /** State means the preview is being initialized by async call of InitializeL()*/
62 /** State means the initialize process has finished and preview is available to be rendered*/
64 /** State means the preview is being rendered by async call of RenderL()*/
67 /** Count of valid preview states (boundary marker - not a true state). */
72 IMPORT_C void SupportedImageFrameFormatsL(RArray<TUid>& aFormats) const;
73 IMPORT_C void SupportedOutputDisplayModesL(RArray<TDisplayMode>& aDisplayModes) const;
75 IMPORT_C void SetOutputL(CFbsBitmap& aBitmap);
76 IMPORT_C void SetOutputL(CImageFrame& aPixelBuffer);
78 IMPORT_C CImageFrame* CreateOutputL(const TSize &aFrameSize, const TFrameFormatBase &aFrameFormat, const TFrameLayoutBase &aFrameLayout);
80 IMPORT_C void InitializeL();
81 IMPORT_C void UninitializeL();
83 IMPORT_C void RenderL();
84 IMPORT_C void ResetL();
85 IMPORT_C void Cancel();
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);
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;
99 IMPORT_C void PreviewToCurrentCoordL(const TPoint& aPreviewPoint, TPoint& aCurrentPoint) const;
100 IMPORT_C void CanvasToCurrentCoordL(const TPoint& aCanvasPoint, TPoint& aCurrentPoint) const;
102 IMPORT_C TPreview::TState State() const;
105 friend class CImageProcessorImpl;
106 CImageProcessorImpl& iImageProcessorImpl;
107 TPreview(Plugin::MPreview& aPreviewImpl, CImageProcessorImpl& aImageProcessorImpl);
109 void SetStateL(TPreview::TState aState);
111 static const TBool iValidStates[TPreview::EStatesCount][TPreview::EStatesCount];
112 Plugin::MPreview& iPreviewImpl;
114 TPreview::TState iState;
116 TInt iReserved; // future proof
119 } //namespace ImageProcessor
121 #endif //__IMAGE_PROCESSOR_PREVIEW_H__