ImageProcessor::TPreview Class Reference

#include <imageprocessor/imageprocessorpreview.h>

Link against: imageprocessor.lib

class ImageProcessor::TPreview
Public Member Enumerations
enumTState { EUninitialized, EInitializing, EInitialized, ERendering, EStatesCount }
Public Member Functions
IMPORT_C voidCancel()
IMPORT_C TRectCanvasAreaL()
IMPORT_C voidCanvasToCurrentCoordL(const TPoint &, TPoint &)
IMPORT_C CImageFrame *CreateOutputL(const TSize &, const TFrameFormatBase &, const TFrameLayoutBase &)
IMPORT_C voidGetPanLevelSettings(TReal32 &, TReal32 &)
IMPORT_C voidGetZoomLevelSettings(TReal32 &, TReal32 &)
IMPORT_C voidInitializeL()
IMPORT_C voidPanL(TReal32 &, TReal32 &)
IMPORT_C TIntPreviewId()
IMPORT_C voidPreviewToCurrentCoordL(const TPoint &, TPoint &)
IMPORT_C voidRenderL()
IMPORT_C voidResetL()
IMPORT_C voidSetOutputL(CFbsBitmap &)
IMPORT_C voidSetOutputL(CImageFrame &)
IMPORT_C voidSetPanL(TReal32, TReal32)
IMPORT_C voidSetPreviewId(TInt)
IMPORT_C voidSetZoomL(TReal32)
IMPORT_C TSizeSizeL()
IMPORT_C TPreview::TStateState()
IMPORT_C voidSupportedImageFrameFormatsL(RArray< TUid > &)
IMPORT_C voidSupportedOutputDisplayModesL(RArray< TDisplayMode > &)
IMPORT_C voidUninitializeL()
IMPORT_C TReal32ZoomL()

Detailed Description

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 supplied pixel buffer. Typically this is a low resolution representation of the image which allows effects and operations to be applied quickly to the image without needing to process the whole image.

Member Enumeration Documentation

Enum TState

The state of the preview screen

EnumeratorValueDescription
EUninitialized

State means the preview has not been initialized, need to call InitializeL() to initialize

EInitializing

State means the preview is being initialized by async call of InitializeL()

EInitialized

State means the initialize process has finished and preview is available to be rendered

ERendering

State means the preview is being rendered by async call of RenderL()

EStatesCount

Count of valid preview states (boundary marker - not a true state).

Member Function Documentation

Cancel ( )

IMPORT_C voidCancel()

Cancels the preview rendering if the preview state is EInitializing or ERendering, unconditionally aborts the operation.

CanvasAreaL ( )

IMPORT_C TRectCanvasAreaL()const

Gets the current canvas as TRect in the given screen

Return Value
The current canvas of the preview screen.
Leave Codes
KErrNotReadyThe current state is EUninitialized.
OtherA range of system wide error codes.

CanvasToCurrentCoordL ( const TPoint &, TPoint & )

IMPORT_C voidCanvasToCurrentCoordL(const TPoint &aCanvasPoint,
TPoint &aCurrentPoint
)const

Converts a coordinate from canvas to current coordinate system.

Parameters
aCanvasPointA TPoint pointer specifying a screen in which the canvas from which to convert the coordinate is located.
aCurrentPointPointer to a TPoint object with the coordinate to convert. The converted coordinate is stored back into the object.
Leave Codes
KErrNotReadyThe current state is EUninitialized.
OtherA range of system wide error codes.

CreateOutputL ( const TSize &, const TFrameFormatBase &, const TFrameLayoutBase & )

IMPORT_C CImageFrame *CreateOutputL(const TSize &aFrameSize,
const TFrameFormatBase &aFrameFormat,
const TFrameLayoutBase &aFrameLayout
)

Creates an internal pixel buffer for output. Internal buffer size is calculated using aPixelBuffer properties (size, scanline length, display mode).

Parameters
aFrameSizeA reference to a TSize object that defines the frame size in pixels of the CImageFrame object.
aFrameFormatA reference to a TFrameFormatBase object that defines the format of the CImageFrame object.
aFrameLayoutA reference to a TFrameLayoutBase object that defines the memory layout of the CImageFrame object.
Return Value
CImageFrame instance containing newly created pixel buffer. The image frame is owned by the client and deleting it does not delete the pixel buffer which is owned by the image processor framework. The pixel buffer becomes invalid if TPreview::CreateOutputL(const TSize &aFrameSize, const TFrameFormatBase &aFrameFormat, const TFrameLayoutBase &aFrameLayout) or TPreview::SetOutputL(CFbsBitmap& aBitmap) or TPreview::SetOutputL(CImageFrame& aPixelBuffer) calls are made.
Leave Codes
KErrNotReadyThe current state is not EInitialized or the ImageProcessor is busy
OtherA range of system wide error codes.

GetPanLevelSettings ( TReal32 &, TReal32 & )

IMPORT_C voidGetPanLevelSettings(TReal32 &aMinimumLevel,
TReal32 &aMaximumLevel
)

Retrieves the pan level range.

Parameters
aMinimumLevelThe minimum value of the pan factor.
aMaximumLevelThe maximum value of the pan factor.

GetZoomLevelSettings ( TReal32 &, TReal32 & )

IMPORT_C voidGetZoomLevelSettings(TReal32 &aMinimumLevel,
TReal32 &aMaximumLevel
)

Retrieves the zoom level range.

Parameters
aMinimumLevelThe minimum value of the zoom factor.
aMaximumLevelThe maximum value of the zoom factor.

InitializeL ( )

IMPORT_C voidInitializeL()

Initializes the preview.

Leave Codes
KErrNorReadyif preview is not in state
Arange of system wide error code.

PanL ( TReal32 &, TReal32 & )

IMPORT_C voidPanL(TReal32 &aPanX,
TReal32 &aPanY
)const

Gets the current pan factor of the preview screen.

Leave Codes
KErrNotReadyThe current state is EUninitialized or the ImageProcessor is busy.
OtherA range of system wide error codes.

PreviewId ( )

IMPORT_C TIntPreviewId()const

Gets the id of the preview.

Return Value
The id of the preview.

PreviewToCurrentCoordL ( const TPoint &, TPoint & )

IMPORT_C voidPreviewToCurrentCoordL(const TPoint &aPreviewPoint,
TPoint &aCurrentPoint
)const

Converts a coordinate from preview screen to current coordinate system.

Parameters
aPreviewPointA TPoint pointer specifying the preview screen from which to convert the coordinate.
aCurrentPointPointer to a TPoint object with the coordinate to convert. The converted coordinate is stored back into the object.
Leave Codes
KErrNotReadyThe current state is EUninitialized.
OtherA range of system wide error codes.

RenderL ( )

IMPORT_C voidRenderL()

Starts the rendering. The preview state is set to ERendering

Leave Codes
KErrNotReadyThe current state is not EInitialized or the ImageProcessor is busy or input is not set or output is not set.
OtherA range of system wide error codes.

ResetL ( )

IMPORT_C voidResetL()

Resets the preview parameters and state.

SetOutputL ( CFbsBitmap & )

IMPORT_C voidSetOutputL(CFbsBitmap &aBitmap)

Sets CFbsBitmap as the output bitmap of the preview.

Parameters
aBitmapThe output bitmap
Leave Codes
KErrNotReadyThe current state is not EInitialized or the ImageProcessor is busy
Arange of system wide error codes

SetOutputL ( CImageFrame & )

IMPORT_C voidSetOutputL(CImageFrame &aPixelBuffer)

Sets an image frame as the output bitmap of the preview.

Parameters
aPixelBufferThe CImageFrame buffer.
Leave Codes
KErrNotReadyThe current state is not EInitialized or the ImageProcessor is busy
OtherA range of system wide error codes.

SetPanL ( TReal32, TReal32 )

IMPORT_C voidSetPanL(TReal32aPanX,
TReal32aPanY
)

Specifies the pan factor for the preview screen. The zoomed screen will be panned to the new coordinate after rendering.

Parameters
aPanXThe horizontal pan factor for the current preview, -1.0f to 1.0f.
aPanYThe vertical pan factor for the current preview, -1.0f to 1.0f.
Leave Codes
KErrNotReadyThe current state is not EInitialized or the ImageProcessor is busy
KErrArgumentThe pan factor is out of range.
OtherA range of system wide error codes.

SetPreviewId ( TInt )

IMPORT_C voidSetPreviewId(TIntaPreviewId)

Specifies the id of the preview.

Parameters
aPreviewIdThe id of the current preview

SetZoomL ( TReal32 )

IMPORT_C voidSetZoomL(TReal32aZoom)

Specifies the zoom factor for the preview screen. The screen will be zoomed after rendering.

Parameters
aZoomThe zoom factor for the current preview, 1.0f to infinite.
Leave Codes
KErrNotReadyThe current state is not EInitialized or the ImageProcessor is busy.
OtherA range of system wide error codes.

SizeL ( )

IMPORT_C TSizeSizeL()const

Gets the current size of the preview screen.

Return Value
The current size of the preview screen.
Leave Codes
KErrNotReadyThe current state is EUninitialized.
OtherA range of system wide error codes.

State ( )

IMPORT_C TPreview::TStateState()const

Gets the current state of the preview.

Return Value
The current state of the preview.

SupportedImageFrameFormatsL ( RArray< TUid > & )

IMPORT_C voidSupportedImageFrameFormatsL(RArray< TUid > &aFormats)const

Gets the supported output formats for the preview.

Return Value
The supported output image formats.

SupportedOutputDisplayModesL ( RArray< TDisplayMode > & )

IMPORT_C voidSupportedOutputDisplayModesL(RArray< TDisplayMode > &aDisplayModes)const

Gets the supported output display modes for the preview.

Return Value
The supported output display modes.

UninitializeL ( )

IMPORT_C voidUninitializeL()

Uninitializes the preview.

Leave Codes
KErrNotReadyThe current state is not EInitialized or the ImageProcessor is busy
OtherA range of system wide error codes.

ZoomL ( )

IMPORT_C TReal32ZoomL()const

Gets the current zoom factor of the preview screen.

Return Value
The current zoom factor of the preview screen.
Leave Codes
KErrNotReadyThe current state is EUninitialized or the ImageProcessor is busy.
OtherA range of system wide error codes.