CImageDisplay Class Reference

#include <imagedisplay.h>

Link against: imagedisplay.lib

class CImageDisplay : public CBase, public CBase

Inherits from

Detailed Description

The public API for clients to call the Image Display library. This class provides functions to convert images stored in descriptors or files to bitmaps ready for display.

Member Type Definition Documentation

Typedef RImageSizeArray

typedef RArray< TSize >RImageSizeArray

An array containing the sizes of images.

Member Enumeration Documentation

Enum TImageOptions

Flags to control how the image is handled These can be combined using an OR operation. Note that the rotate and mirror options have to be set together with EOptionThumbnail or EOptionMainImage.

EnumeratorValueDescription
EOptionsUndefined0x00000000

No options defined

EOptionThumbnail0x00000001

Use the thumbnail image as source

EOptionMainImage0x00000002

Use the main image as source

EOptionRotateCw900x00000004

Rotate the image by 90 degrees clockwise

EOptionRotateCw1800x00000008

Rotate the image by 180 degrees clockwise

EOptionRotateCw2700x00000010

Rotate the image by 270 degrees clockwise

EOptionMirrorHorizontal0x00000020

Mirror an image about the horizontal axis

EOptionMirrorVertical0x00000040

Mirror an image about the vertical axis

EOptionAutoRotate0x00000080

Rotate the image automatically (if necessary)

Enum TImageStatus

Return flags from ImageStatus()

EnumeratorValueDescription
EImageTypeUnknown0x00000000

ImageStatus is unknown

EImageSingleFrame0x00000001

Image is single frame

EImageMultiFrame0x00000002

Image is multiframe

EImageAnimated0x00000004

Image is animated

EImageMasked0x00000008

Image has got a mask/alpha channel

EImageHasThumbnail0x00000010

Image has got a thumbnail

EImageIsFullyScalable0x00000020

Image is fully scalable i.e. arbitrary scaling can be perofmed quite quickly

Constructor & Destructor Documentation

~CImageDisplay ( )

IMPORT_C~CImageDisplay()

This is the destructor for this class and is responsible for deallocating all resources

Member Function Documentation

ExtensionInterface ( TUid, TAny *& )

IMPORT_C TIntExtensionInterface(TUidaIFaceUid,
TAny *&aIFacePtr
)
Gets a pointer to a plugin extension
Parameters
aIFaceUidRequested extension interface Uid
aIFacePtrReference to pointer which would have interface pointer on sucessful completion, otherwise NULL
Return Value
KErrNotSupported if given extension interface is not supported or other system-wide error code
Panic Codes
ImageDisplay1 EIllegalCallSequence No plugin loaded.

GetBitmap ( const CFbsBitmap *&, const CFbsBitmap *& )

IMPORT_C voidGetBitmap(const CFbsBitmap *&aBitmap,
const CFbsBitmap *&aMask
)const

Gets a reference to the current bitmap and mask

See also: SetDisplayMode

Parameters
aBitmapReference to pointer which would have current frame bitmap address.
aMaskReference to pointer which would have current frame mask address. This is NULL if no mask is available or if aBitmap has a display mode of EColor16MA (see SetDisplayMode()).
Panic Codes
ImageDisplay1 EIllegalCallSequence No plugin loaded or decoding was not started

ImageStatus ( )

IMPORT_C TUintImageStatus()const
returns an integer, corresponding to the current image status (if known), the value will be comprised of elements of the TImageStatus bit field
Return Value
a combination TImageStatus flags
Panic Codes
ImageDisplay1 EIllegalCallSequence No plugin loaded.

NewL ( MIclImageDisplayObserver &, RFs & )

IMPORT_C CImageDisplay *NewL(MIclImageDisplayObserver &aCallback,
RFs &aFs
)[static]

Constructs a CImageDisplay object.

Parameters
aCallbackA reference to a Image Display observer object which would recieve status notifications
aFsA reference to a file server session for the display API to use.
Return Value
A pointer to a fully constructed CImageDisplay.

NumFrames ( TInt & )

IMPORT_C TIntNumFrames(TInt &aNumFrames)const
returns the number of frames (if known) or an error code if unknown.
Parameters
aNumFramesa reference to frame number parameter which has meaning only if retrun value is KErrNone
Return Value
KErrNotSupported if a plug-in can't determine number of frames
Panic Codes
ImageDisplay1 EIllegalCallSequence No plugin loaded.

Pause ( )

IMPORT_C voidPause()

Instructs a plug-in to pause its operation. An operation can be resumed by calling the Play() The framework will panic if no plugin has been instantiated already and Play() has not been called yet.

Panic Codes
ImageDisplay1 EIllegalCallSequence No plugin loaded.

Play ( )

IMPORT_C voidPlay()

Initiates an image display operation. The framework will panic if no plugin has been instantiated already. Note: That a plugin may perform some asynchronous operations within the current thread, so yielding to the Active Scheduler after calling this function is almost mandatory

Panic Codes
ImageDisplay1 EIllegalCallSequence No plugin loaded.
ImageDisplay3 EUndefinedDestSize Raised when destination image size is not defined yet

RecommendedImageSizes ( )

IMPORT_C const RImageSizeArray &RecommendedImageSizes()const
Returns an array of recommended image sizes i.e. sizes which would be processed faster
Return Value
a reference to the array of recommended image sizes
Panic Codes
ImageDisplay1 EIllegalCallSequence No plugin loaded.

Reset ( )

IMPORT_C voidReset()

Resets all SetXXX() calls so that the state is the same as that immediately after a call to NewL(). Deletes the plugin if one is loaded.

ResetSourceRect ( )

IMPORT_C voidResetSourceRect()

Clears settings for the clipping region, but not the image region

Panic Codes
ImageDisplay1 EIllegalCallSequence Raised if the function was called during decoding stage or a plugin is not loaded yet

SetDisplayMode ( TDisplayMode )

IMPORT_C voidSetDisplayMode(TDisplayModeaDisplayMode)

Specifies the requested image display mode.

Parameters
aDisplayModeThe requested display mode
Panic Codes
ImageDisplay1 EIllegalCallSequence Raised if the function was called during decoding stage or a plugin is not loaded yet

SetImageSource ( const TMMSource & )

IMPORT_C TIntSetImageSource(const TMMSource &aSource)

Specifies the source of the image to display

Parameters
aSourceThe data source container. Note that the framework doesn't take a copy of actual data/filename etc. and they must persist during decoding
Return Value
KErrNone if the given source type is supported, otherwise KErrNotSupported
Panic Codes
ImageDisplay1 EIllegalCallSequence Raised if the function was called during decoding stage

SetOptions ( TUint )

IMPORT_C TIntSetOptions(TUintaOptions)

Defines how the image is to be displayed.

Note that all plugins support EOptionMainImage, whereas the availability of the other options depends on the image display plugin loaded.

Parameters
aOptions- image type selected using the TImageOptions flag set
Return Value
KErrArgument on wrong combination of options, especially if the rotate and mirror options aren't set together with EOptionThumbnail or EOptionMainImage.
Panic Codes
ImageDisplay1 EIllegalCallSequence Raised if the function was called during decoding stage or a plugin is not loaded yet

SetPluginUid ( TUid )

IMPORT_C voidSetPluginUid(TUidaPluginUid)

Specifies the UID of the image display plugin to load

Parameters
aPluginUidThe plugin's implementation UID
Panic Codes
ImageDisplay1 EIllegalCallSequence Raised when a plugin is already loaded

SetSizeInPixels ( const TSize &, TBool )

IMPORT_C voidSetSizeInPixels(const TSize &aSize,
TBoolaMaintainAspectRatio = ETrue
)

Specifies the requested image size.

Parameters
aSizeThe requested size of the image in pixels
aMaintainAspectRatioRequests that the aspect ratio be maintained as far as possible Defaults to true
Panic Codes
ImageDisplay1 EIllegalCallSequence Raised if the function was called during decoding stage or a plugin is not loaded yet

SetSourceImageType ( TUid, TUid )

IMPORT_C voidSetSourceImageType(TUidaImageType,
TUidaImageSubType = TUid::Null()
)

Specifies the source image's type and (optionally) its subtype

Parameters
aImageTypeThe UID of the source image's type
aImageSubTypeThe UID of the source image's subtype
Panic Codes
ImageDisplay1 EIllegalCallSequence Raised if the function was called during decoding stage or a plugin is not loaded yet

SetSourceMimeType ( const TDesC8 & )

IMPORT_C voidSetSourceMimeType(const TDesC8 &aMIMEType)

Specifies the MIME type of the source image.

Parameters
aMIMETypeThe MIME type of the source image
Panic Codes
ImageDisplay1 EIllegalCallSequence Raised if the function was called during decoding stage

SetSourceRect ( const TRect & )

IMPORT_C voidSetSourceRect(const TRect &aRect)

Defines a clipping region. Only the specified region will be processed.

Parameters
aRectThe coordinates of the clipping region
Panic Codes
ImageDisplay1 EIllegalCallSequence Raised if the function was called during decoding stage or a plugin is not loaded yet

SetupL ( )

IMPORT_C voidSetupL()

Requests that a suitable plugin be selected and instantiated. Leaves with KErrNotFound if no suitable plugin found or if the framework or plugin finds any error in any of the preceeding SetXXX() calls

Leave Codes
KErrNotFoundNo suitable plugin was found
KErrArgumentOne of the previously supplied parameters (image size, mime type etc.) is invalid
Panic Codes
ImageDisplay2 EUndefinedSourceType Raised when image source is not defined yet

StopPlay ( )

IMPORT_C voidStopPlay()

Cancels any image display operation currently in progress.

Panic Codes
ImageDisplay1 EIllegalCallSequence Raised when no plugin loaded yet.

ValidBitmap ( )

IMPORT_C TBoolValidBitmap()const

Check to see if the current frame can be displayed now

Return Value
ETrue The current bitmap contains a valid image. It will return ETrue only when it is called in between the ImageReady() callback and a subsequent call to Play().
Panic Codes
ImageDisplay1 EIllegalCallSequence No plugin loaded or decoding was not started