epoc32/include/imageprocessor/imageprocessorpreview.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/imageprocessor/imageprocessorpreview.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,121 @@
     1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +/**
    1.20 + @file
    1.21 + @publishedAll 
    1.22 + @released 
    1.23 +*/
    1.24 +
    1.25 +#ifndef __IMAGE_PROCESSOR_PREVIEW_H__
    1.26 +#define __IMAGE_PROCESSOR_PREVIEW_H__
    1.27 +
    1.28 +#include <e32base.h>
    1.29 +#include <gdi.h>
    1.30 +#include <imageframe.h>
    1.31 +
    1.32 +class CFbsBitmap;
    1.33 +class CImageFrame;
    1.34 +
    1.35 +namespace ImageProcessor
    1.36 +	{
    1.37 +
    1.38 +class CImageProcessorImpl;
    1.39 +
    1.40 +namespace Plugin
    1.41 +	{
    1.42 +	class MPreview;
    1.43 +	}
    1.44 +
    1.45 +/**
    1.46 +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 
    1.47 +supplied pixel buffer. Typically this is a low resolution representation of the image which allows effects and operations
    1.48 +to be applied quickly to the image without needing to process the whole image.
    1.49 +
    1.50 +@publishedAll
    1.51 +@released
    1.52 +*/
    1.53 +class TPreview
    1.54 +	{
    1.55 +public:
    1.56 +	/**
    1.57 +	The state of the preview screen
    1.58 +	*/
    1.59 +	enum TState 
    1.60 +		{
    1.61 +		/** State means the preview has not been initialized, need to call InitializeL() to initialize*/
    1.62 +		EUninitialized,
    1.63 +		/** State means the preview is being initialized by async call of InitializeL()*/
    1.64 +		EInitializing,
    1.65 +		/** State means the initialize process has finished and preview is available to be rendered*/
    1.66 +		EInitialized,
    1.67 +		/** State means the preview is being rendered by async call of RenderL()*/
    1.68 +		ERendering,
    1.69 +
    1.70 +        /** Count of valid preview states (boundary marker - not a true state). */
    1.71 +		EStatesCount
    1.72 +		};
    1.73 +
    1.74 +public:
    1.75 +	IMPORT_C void SupportedImageFrameFormatsL(RArray<TUid>& aFormats) const;
    1.76 +	IMPORT_C void SupportedOutputDisplayModesL(RArray<TDisplayMode>& aDisplayModes) const;
    1.77 +	
    1.78 +	IMPORT_C void SetOutputL(CFbsBitmap& aBitmap);
    1.79 +	IMPORT_C void SetOutputL(CImageFrame& aPixelBuffer);
    1.80 +	
    1.81 +	IMPORT_C CImageFrame* CreateOutputL(const TSize &aFrameSize, const TFrameFormatBase &aFrameFormat, const TFrameLayoutBase &aFrameLayout);
    1.82 +
    1.83 +	IMPORT_C void InitializeL();
    1.84 +	IMPORT_C void UninitializeL();
    1.85 +
    1.86 +	IMPORT_C void RenderL();
    1.87 +	IMPORT_C void ResetL();
    1.88 +	IMPORT_C void Cancel();
    1.89 +		
    1.90 +	IMPORT_C void SetZoomL(TReal32 aZoom);
    1.91 +	IMPORT_C void SetPanL(TReal32 aPanX, TReal32 aPanY);
    1.92 +	IMPORT_C void SetPreviewId(TInt aPreviewId);
    1.93 +	IMPORT_C void GetZoomLevelSettings(TReal32& aMinimumLevel, TReal32& aMaximumLevel);
    1.94 +	IMPORT_C void GetPanLevelSettings(TReal32& aMinimumLevel, TReal32& aMaximumLevel);
    1.95 +		
    1.96 +	IMPORT_C TReal32 ZoomL() const;
    1.97 +	IMPORT_C void PanL(TReal32& aPanX, TReal32& aPanY) const;
    1.98 +	IMPORT_C TSize SizeL() const;
    1.99 +	IMPORT_C TRect CanvasAreaL() const;
   1.100 +	IMPORT_C TInt PreviewId() const;
   1.101 +	
   1.102 +	IMPORT_C void PreviewToCurrentCoordL(const TPoint& aPreviewPoint, TPoint& aCurrentPoint) const;
   1.103 +	IMPORT_C void CanvasToCurrentCoordL(const TPoint& aCanvasPoint, TPoint& aCurrentPoint) const;
   1.104 +
   1.105 +	IMPORT_C TPreview::TState State() const;
   1.106 +
   1.107 +private:
   1.108 +	friend class CImageProcessorImpl;
   1.109 +	CImageProcessorImpl& iImageProcessorImpl;
   1.110 +	TPreview(Plugin::MPreview& aPreviewImpl, CImageProcessorImpl& aImageProcessorImpl);
   1.111 +
   1.112 +	void SetStateL(TPreview::TState aState);
   1.113 +
   1.114 +	static const TBool iValidStates[TPreview::EStatesCount][TPreview::EStatesCount];
   1.115 +	Plugin::MPreview& iPreviewImpl;
   1.116 +	
   1.117 +	TPreview::TState iState;
   1.118 +	TBool iIsOutputSet;
   1.119 +	TInt iReserved; // future proof
   1.120 +	};
   1.121 +
   1.122 +	} //namespace ImageProcessor
   1.123 +
   1.124 +#endif //__IMAGE_PROCESSOR_PREVIEW_H__