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

leave
KErrNotReady The current state is EUninitialized.
leave
Other A range of system wide error codes.

Returns: The current canvas of the preview screen.

CanvasToCurrentCoordL ( const TPoint &, TPoint & )

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

Converts a coordinate from canvas to current coordinate system.

leave
KErrNotReady The current state is EUninitialized.
leave
Other A range of system wide error codes.
ParameterDescription
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.

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).

leave
KErrNotReady The current state is not EInitialized or the ImageProcessor is busy
leave
Other A range of system wide error codes.
ParameterDescription
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.

Returns: 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.

GetPanLevelSettings ( TReal32 &, TReal32 & )

IMPORT_C voidGetPanLevelSettings(TReal32 &aMinimumLevel,
TReal32 &aMaximumLevel
)

Retrieves the pan level range.

ParameterDescription
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.

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

InitializeL ( )

IMPORT_C voidInitializeL()

Initializes the preview.

leave
KErrNorReady if preview is not in state TPreview::EUninitialized
leave
A range 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
KErrNotReady The current state is EUninitialized or the ImageProcessor is busy.
leave
Other A range of system wide error codes.

PreviewId ( )

IMPORT_C TIntPreviewId()const

Gets the id of the preview.

Returns: 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.

leave
KErrNotReady The current state is EUninitialized.
leave
Other A range of system wide error codes.
ParameterDescription
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.

RenderL ( )

IMPORT_C voidRenderL()

Starts the rendering. The preview state is set to ERendering

leave
KErrNotReady The current state is not EInitialized or the ImageProcessor is busy or input is not set or output is not set.
leave
Other A 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.

leave
KErrNotReady The current state is not EInitialized or the ImageProcessor is busy
leave
A range of system wide error codes
ParameterDescription
aBitmapThe output bitmap

SetOutputL ( CImageFrame & )

IMPORT_C voidSetOutputL(CImageFrame &aPixelBuffer)

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

leave
KErrNotReady The current state is not EInitialized or the ImageProcessor is busy
leave
Other A range of system wide error codes.
ParameterDescription
aPixelBufferThe CImageFrame buffer.

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.

leave
KErrNotReady The current state is not EInitialized or the ImageProcessor is busy
leave
KErrArgument The pan factor is out of range.
leave
Other A range of system wide error codes.
ParameterDescription
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.

SetPreviewId ( TInt )

IMPORT_C voidSetPreviewId(TIntaPreviewId)

Specifies the id of the preview.

ParameterDescription
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.

leave
KErrNotReady The current state is not EInitialized or the ImageProcessor is busy.
leave
Other A range of system wide error codes.
ParameterDescription
aZoomThe zoom factor for the current preview, 1.0f to infinite.

SizeL ( )

IMPORT_C TSizeSizeL()const

Gets the current size of the preview screen.

leave
KErrNotReady The current state is EUninitialized.
leave
Other A range of system wide error codes.

Returns: The current size of the preview screen.

State ( )

IMPORT_C TPreview::TStateState()const

Gets the current state of the preview.

Returns: The current state of the preview.

SupportedImageFrameFormatsL ( RArray< TUid > & )

IMPORT_C voidSupportedImageFrameFormatsL(RArray< TUid > &aFormats)const

Gets the supported output formats for the preview.

Returns: The supported output image formats.

SupportedOutputDisplayModesL ( RArray< TDisplayMode > & )

IMPORT_C voidSupportedOutputDisplayModesL(RArray< TDisplayMode > &aDisplayModes)const

Gets the supported output display modes for the preview.

Returns: The supported output display modes.

UninitializeL ( )

IMPORT_C voidUninitializeL()

Uninitializes the preview.

leave
KErrNotReady The current state is not EInitialized or the ImageProcessor is busy
leave
Other A range of system wide error codes.

ZoomL ( )

IMPORT_C TReal32ZoomL()const

Gets the current zoom factor of the preview screen.

leave
KErrNotReady The current state is EUninitialized or the ImageProcessor is busy.
leave
Other A range of system wide error codes.

Returns: The current zoom factor of the preview screen.