Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: ImageDisplay.h
Link against: imagedisplay.lib

This item is not part of the S60 3rd Edition SDK for Symbian OS, Feature Pack 2.

Class CImageDisplay

class CImageDisplay : public CBase;

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.

Derivation

Members

Defined in CImageDisplay:
EImageAnimated, EImageHasThumbnail, EImageIsFullyScalable, EImageMasked, EImageMultiFrame, EImageSingleFrame, EImageTypeUnknown, EOptionAutoRotate, EOptionMainImage, EOptionMirrorHorizontal, EOptionMirrorVertical, EOptionRotateCw180, EOptionRotateCw270, EOptionRotateCw90, EOptionThumbnail, EOptionsUndefined, ExtensionInterface(), GetBitmap(), ImageStatus(), NewL(), NumFrames(), Pause(), Play(), RImageSizeArray, RecommendedImageSizes(), Reset(), ResetSourceRect(), SetDisplayMode(), SetImageSource(), SetOptions(), SetPluginUid(), SetSizeInPixels(), SetSourceImageType(), SetSourceMimeType(), SetSourceRect(), SetupL(), StopPlay(), TImageOptions, TImageStatus, ValidBitmap(), ~CImageDisplay()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


NewL()

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

Description

Constructs a CImageDisplay object.

Parameters

MIclImageDisplayObserver &aCallback

A reference to a Image Display observer object which would recieve status notifications

RFs &aFs

A reference to a file server session for the display API to use.

Return value

CImageDisplay *

A pointer to a fully constructed CImageDisplay.


~CImageDisplay()

IMPORT_C ~CImageDisplay();

Description

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

[Top]


Member functions


SetPluginUid()

IMPORT_C void SetPluginUid(TUid aPluginUid);

Description

Specifies the UID of the image display plugin to load

Parameters

TUid aPluginUid

The plugin's implementation UID

Panic codes

ImageDisplay

1 EIllegalCallSequence Raised when a plugin is already loaded


SetImageSource()

IMPORT_C TInt SetImageSource(const TMMSource &aSource);

Description

Specifies the source of the image to display

Parameters

const TMMSource &aSource

The 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

TInt

KErrNone if the given source type is supported, otherwise KErrNotSupported

Panic codes

ImageDisplay

1 EIllegalCallSequence Raised if the function was called during decoding stage


SetSourceMimeType()

IMPORT_C void SetSourceMimeType(const TDesC8 &aMIMEType);

Description

Specifies the MIME type of the source image.

Parameters

const TDesC8 &aMIMEType

The MIME type of the source image

Panic codes

ImageDisplay

1 EIllegalCallSequence Raised if the function was called during decoding stage


SetSourceImageType()

IMPORT_C void SetSourceImageType(TUid aImageType, TUid aImageSubType=TUid::Null());

Description

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

Parameters

TUid aImageType

The UID of the source image's type

TUid aImageSubType

The UID of the source image's subtype

Panic codes

ImageDisplay

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


SetSourceRect()

IMPORT_C void SetSourceRect(const TRect &aRect);

Description

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

Parameters

const TRect &aRect

The coordinates of the clipping region

Panic codes

ImageDisplay

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


ResetSourceRect()

IMPORT_C void ResetSourceRect();

Description

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

Panic codes

ImageDisplay

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


SetSizeInPixels()

IMPORT_C void SetSizeInPixels(const TSize &aSize, TBool aMaintainAspectRatio=ETrue);

Description

Specifies the requested image size.

Parameters

const TSize &aSize

The requested size of the image in pixels

TBool aMaintainAspectRatio

Requests that the aspect ratio be maintained as far as possible Defaults to true

Panic codes

ImageDisplay

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


SetDisplayMode()

IMPORT_C void SetDisplayMode(TDisplayMode aDisplayMode);

Description

Specifies the requested image display mode.

Parameters

TDisplayMode aDisplayMode

The requested display mode

Panic codes

ImageDisplay

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


SetOptions()

IMPORT_C TInt SetOptions(TUint aOptions);

Description

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

TUint aOptions

- image type selected using the TImageOptions flag set

Return value

TInt

KErrArgument on wrong combination of options, especially if the rotate and mirror options aren't set together with EOptionThumbnail or EOptionMainImage.

Panic codes

ImageDisplay

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


SetupL()

IMPORT_C void SetupL();

Description

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

KErrNotFound

No suitable plugin was found

KErrArgument

One of the previously supplied parameters (image size, mime type etc.) is invalid

Panic codes

ImageDisplay

2 EUndefinedSourceType Raised when image source is not defined yet


Play()

IMPORT_C void Play();

Description

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

ImageDisplay

1 EIllegalCallSequence No plugin loaded.

ImageDisplay

3 EUndefinedDestSize Raised when destination image size is not defined yet


Pause()

IMPORT_C void Pause();

Description

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

ImageDisplay

1 EIllegalCallSequence No plugin loaded.


StopPlay()

IMPORT_C void StopPlay();

Description

Cancels any image display operation currently in progress.

Panic codes

ImageDisplay

1 EIllegalCallSequence Raised when no plugin loaded yet.


Reset()

IMPORT_C void Reset();

Description

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.


ExtensionInterface()

IMPORT_C TInt ExtensionInterface(TUid aIFaceUid, TAny *&aIFacePtr);

Description

Gets a pointer to a plugin extension

Parameters

TUid aIFaceUid

Requested extension interface Uid

TAny *&aIFacePtr

Reference to pointer which would have interface pointer on sucessful completion, otherwise NULL

Return value

TInt

KErrNotSupported if given extension interface is not supported or other system-wide error code

Panic codes

ImageDisplay

1 EIllegalCallSequence No plugin loaded.


ValidBitmap()

IMPORT_C TBool ValidBitmap() const;

Description

Check to see if the current frame can be displayed now

Return value

TBool

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

ImageDisplay

1 EIllegalCallSequence No plugin loaded or decoding was not started


RecommendedImageSizes()

IMPORT_C const RImageSizeArray &RecommendedImageSizes() const;

Description

Returns an array of recommended image sizes i.e. sizes which would be processed faster

Return value

const RImageSizeArray &

a reference to the array of recommended image sizes

Panic codes

ImageDisplay

1 EIllegalCallSequence No plugin loaded.


GetBitmap()

IMPORT_C void GetBitmap(const CFbsBitmap *&aBitmap, const CFbsBitmap *&aMask) const;

Description

Gets a reference to the current bitmap and mask

Parameters

const CFbsBitmap *&aBitmap

Reference to pointer which would have current frame bitmap address

const CFbsBitmap *&aMask

Reference to pointer which would have current frame mask address or NULL if no mask available

Panic codes

ImageDisplay

1 EIllegalCallSequence No plugin loaded or decoding was not started


ImageStatus()

IMPORT_C TUint ImageStatus() const;

Description

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

TUint

a combination TImageStatus flags

Panic codes

ImageDisplay

1 EIllegalCallSequence No plugin loaded.


NumFrames()

IMPORT_C TInt NumFrames(TInt &aNumFrames) const;

Description

returns the number of frames (if known) or an error code if unknown.

Parameters

TInt &aNumFrames

a reference to frame number parameter which has meaning only if retrun value is KErrNone

Return value

TInt

KErrNotSupported if a plug-in can't determine number of frames

Panic codes

ImageDisplay

1 EIllegalCallSequence No plugin loaded.

[Top]


Member enumerations


Enum TImageOptions

TImageOptions

Description

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.

EOptionsUndefined

No options defined

EOptionThumbnail

Use the thumbnail image as source

EOptionMainImage

Use the main image as source

EOptionRotateCw90

Rotate the image by 90 degrees clockwise

EOptionRotateCw180

Rotate the image by 180 degrees clockwise

EOptionRotateCw270

Rotate the image by 270 degrees clockwise

EOptionMirrorHorizontal

Mirror an image about the horizontal axis

EOptionMirrorVertical

Mirror an image about the vertical axis

EOptionAutoRotate

Rotate the image automatically (if necessary)


Enum TImageStatus

TImageStatus

Description

Return flags from ImageStatus()

EImageTypeUnknown

ImageStatus is unknown

EImageSingleFrame

Image is single frame

EImageMultiFrame

Image is multiframe

EImageAnimated

Image is animated

EImageMasked

Image has got a mask/alpha channel

EImageHasThumbnail

Image has got a thumbnail

EImageIsFullyScalable

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

[Top]


Member type definitions


Typedef RImageSizeArray

typedef RArray<TSize> CImageDisplay::RImageSizeArray;

Description

An array containing the sizes of images.