ImageProcessor::TPreview Class Reference

class ImageProcessor::TPreview

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.

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()
Private Member Functions
TPreview(Plugin::MPreview &, CImageProcessorImpl &)
voidSetStateL(TPreview::TState)
Public Member Enumerations
enumTState { EUninitialized, EInitializing, EInitialized, ERendering, EStatesCount }
Private Attributes
CImageProcessorImpl &iImageProcessorImpl
TBool iIsOutputSet
Plugin::MPreview &iPreviewImpl
TInt iReserved
TPreview::TState iState
const TBooliValidStates

Constructor & Destructor Documentation

TPreview(Plugin::MPreview &, CImageProcessorImpl &)

TPreview(Plugin::MPreview &aPreviewImpl,
CImageProcessorImpl &aImageProcessorImpl
)[private]

Parameters

Plugin::MPreview & aPreviewImpl
CImageProcessorImpl & aImageProcessorImpl

Member Functions 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

The current canvas of the preview screen.

leave

KErrNotReady The current state is EUninitialized.

leave

Other A 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.

leave

KErrNotReady The current state is EUninitialized.

leave

Other A range of system wide error codes.

Parameters

const TPoint & aCanvasPointA TPoint pointer specifying a screen in which the canvas from which to convert the coordinate is located.
TPoint & 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.

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.

Parameters

const TSize & aFrameSizeA reference to a TSize object that defines the frame size in pixels of the CImageFrame object.
const TFrameFormatBase & aFrameFormatA reference to a TFrameFormatBase object that defines the format of the CImageFrame object.
const TFrameLayoutBase & aFrameLayoutA reference to a TFrameLayoutBase object that defines the memory layout of the CImageFrame object.

GetPanLevelSettings(TReal32 &, TReal32 &)

IMPORT_C voidGetPanLevelSettings(TReal32 &aMinimumLevel,
TReal32 &aMaximumLevel
)

Retrieves the pan level range.

Parameters

TReal32 & aMinimumLevelThe minimum value of the pan factor.
TReal32 & aMaximumLevelThe maximum value of the pan factor.

GetZoomLevelSettings(TReal32 &, TReal32 &)

IMPORT_C voidGetZoomLevelSettings(TReal32 &aMinimumLevel,
TReal32 &aMaximumLevel
)

Retrieves the zoom level range.

Parameters

TReal32 & aMinimumLevelThe minimum value of the zoom factor.
TReal32 & 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.

Parameters

TReal32 & aPanX
TReal32 & aPanY

PreviewId()

IMPORT_C TIntPreviewId()const

Gets the id of the preview.

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.

Parameters

const TPoint & aPreviewPointA TPoint pointer specifying the preview screen from which to convert the coordinate.
TPoint & 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

Parameters

CFbsBitmap & 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.

Parameters

CImageFrame & 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.

Parameters

TReal32 aPanXThe horizontal pan factor for the current preview, -1.0f to 1.0f.
TReal32 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.

Parameters

TInt aPreviewIdThe id of the current preview

SetStateL(TPreview::TState)

voidSetStateL(TPreview::TStateaState)[private]

Parameters

TPreview::TState aState

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.

Parameters

TReal32 aZoomThe zoom factor for the current preview, 1.0f to infinite.

SizeL()

IMPORT_C TSizeSizeL()const

Gets the current size of the preview screen.

The current size of the preview screen.

leave

KErrNotReady The current state is EUninitialized.

leave

Other A range of system wide error codes.

State()

IMPORT_C TPreview::TStateState()const

Gets the current state of the preview.

The current state of the preview.

SupportedImageFrameFormatsL(RArray< TUid > &)

IMPORT_C voidSupportedImageFrameFormatsL(RArray< TUid > &aFormats)const

Gets the supported output formats for the preview.

The supported output image formats.

Parameters

RArray< TUid > & aFormats

SupportedOutputDisplayModesL(RArray< TDisplayMode > &)

IMPORT_C voidSupportedOutputDisplayModesL(RArray< TDisplayMode > &aDisplayModes)const

Gets the supported output display modes for the preview.

The supported output display modes.

Parameters

RArray< TDisplayMode > & aDisplayModes

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.

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.

Member Enumerations Documentation

Enum TState

The state of the preview screen

Enumerators

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 Data Documentation

CImageProcessorImpl & iImageProcessorImpl

CImageProcessorImpl &iImageProcessorImpl[private]

TBool iIsOutputSet

TBool iIsOutputSet[private]

Plugin::MPreview & iPreviewImpl

Plugin::MPreview &iPreviewImpl[private]

TInt iReserved

TInt iReserved[private]

TPreview::TState iState

TPreview::TState iState[private]

const TBool iValidStates

const TBooliValidStates[private, static]