Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: ImageConversion.h
Link against: imageconversion.lib

Class CImageDecoder

class CImageDecoder : public CBase;

Description

Provides access to the Image Conversion Library decoders.

This class provides functions to decode images held in files or descriptors. To decode buffered images use the buffered version of this class CBufferedImageDecoder.

Regarding DRM: Note that intent is evaluated when a CImageDecoder instance is being constructed by one of the FileNewL() methods. It is executed after at least one frame of the image has been successfully decoded. Subsequent converts using the same CImageDecoder instance will not execute intent.

Derivation

Members

Defined in CImageDecoder:
Cancel(), ContinueConvert(), ContinueProcessingHeaderL(), Convert(), Convert(), CustomAsync(), CustomSyncL(), DataNewL(), DataNewL(), EAllowGeneratedMask, EImageTypeMain, EImageTypeThumbnail, EOptionAllowZeroFrameOpen, EOptionAlwaysThread, EOptionIgnoreExifMetaData, EOptionNoDither, EOptionNone, EPreferFastDecode, FileNewL(), FileNewL(), FileNewL(), FileNewL(), FileNewL(), FileNewL(), FileNewL(), FileNewL(), FrameCommentL(), FrameCount(), FrameData(), FrameInfo(), FrameInfoStringsL(), FrameInfoStringsLC(), GetFileTypesL(), GetImageSubTypesL(), GetImageTypesL(), GetImplementationInformationL(), GetMimeTypeDataL(), GetMimeTypeFileL(), ImageCommentL(), ImageType(), ImplementationUid(), IsImageHeaderProcessingComplete(), NumberOfFrameComments(), NumberOfImageComments(), Plugin(), ReducedSize(), ReductionFactor(), SetAgentProperty(), SetDecoderThreadPriority(), SetImageTypeL(), TImageType, TOptions, ~CImageDecoder()

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


Construction and destruction


~CImageDecoder()

virtual IMPORT_C ~CImageDecoder();

Description

Destructor for this class.

If using a local file session, it closes it. It also informs ECom that has finished with the decoder instance.

Frees all resources owned by the object prior to its destruction.

[Top]


Member functions


GetImageTypesL()

static IMPORT_C void GetImageTypesL(RImageTypeDescriptionArray &aImageTypeArray);

Description

Get a list of the basic image types that can be decoded, based on the currently available decoder plugins.

Ownership of the array is passed to the caller so, before the array goes out of scope in the client, the caller must call ResetAndDestroy() on it to free the entries.

Parameters

RImageTypeDescriptionArray &aImageTypeArray

An empty array, into which this function will put a list of entries. Each entry will consist of the "display string" from the registry entry for a plugin that has been found and that is a decoder for a basic image type, accompanied by the Uids for that image type. Since we asked for basic types the second Uid, for the image sub-type, will always be zero.


GetImageSubTypesL()

static IMPORT_C void GetImageSubTypesL(const TUid aImageType, RImageTypeDescriptionArray &aSubTypeArray);

Description

For a given basic image type, get a list of the sub image types that can be decoded, based on the currently available decoder plugins.

Ownership of the array is passed to the caller so, before the array goes out of scope in the client, the caller must call ResetAndDestroy() on it to free the entries.

Parameters

const TUid aImageType

The basic image type for which you want a list of sub-types.

RImageTypeDescriptionArray &aSubTypeArray

An empty array, into which this function will put a list of entries. Each entry will consist of the "display string" from the registry entry for a plugin that has been found and that is a decoder for a sub-type of the given basic image type, accompanied by the Uids for the sub type. The first Uid, for the basic type, will always correspond to aImageType.


GetFileTypesL()

static IMPORT_C void GetFileTypesL(RFileExtensionMIMETypeArray &aFileExtensionArray);

Description

Get a list of the file extensions that can be decoded and their corresponding MIME types, based on the currently available decoder plugins.

Ownership of the array is passed to the caller so, before the array goes out of scope in the client, the caller must call ResetAndDestroy() on it to free the entries.

Parameters

RFileExtensionMIMETypeArray &aFileExtensionArray

An empty array, into which this function will put a list of entries. Each entry will consist of a file extension string for which a decoder plugin has been found, accompanied by the primary MIME type and then any secondary MIME types (if present).


GetMimeTypeFileL()

static IMPORT_C void GetMimeTypeFileL(RFs &aFs, const TDesC &aFileName, TDes8 &aMimeType);

Description

Get the primary MIME type of the decoder that will be used to decode a file. Some file types (like OTA or WBPM), which do not have unique pattern in their header may not be recognised, in case when the source file name doesn't have extension or, extension is not common to that file type. Such files are not supported by this API.

Parameters

RFs &aFs

A reference to a file server session to use.

const TDesC &aFileName

The name of the file for which a MIME type has to be determined

TDes8 &aMimeType

An empty descriptor in which the MIME type assosiated with the file will be returned. Ownership is passed to the caller.


GetMimeTypeDataL()

static IMPORT_C void GetMimeTypeDataL(const TDesC8 &aImageData, TDes8 &aMimeType);

Description

Get the primary MIME type of the decoder that will be used to decode a descriptor. Some file types (like OTA or WBPM), which do not have unique pattern in their header may not be recognised. Such files are not supported by this API

Parameters

const TDesC8 &aImageData

A descriptor containing the image data for which a MIME type has to be determined.

TDes8 &aMimeType

An empty descriptor in which the MIME type assosiated with the file will be returned. Ownership is passed to the caller.


GetImplementationInformationL()

static IMPORT_C CImplementationInformationType *GetImplementationInformationL(TUid aImplementationUid);

Description

Gets the implementation information for a specific decoder plugin

Ownership of the implementation information is passed to the caller.

Parameters

TUid aImplementationUid

The decoder implementation UID for which to retrieve implementation information

Return value

CImplementationInformationType *

A pointer to the implementation information.


FileNewL()

static IMPORT_C CImageDecoder *FileNewL(RFs &aFs, const TDesC &aSourceFilename, const TDesC8 &aMIMEType, const TOptions aOptions=EOptionNone);

Description

Create a decoder for the image in the named file. The client supplies a MIME type which will be used to try and select an appropriate plugin decoder. If it finds a decoder it creates it and then goes on to use that decoder to scan the beginning of the image file.

If any file related errors are encountered opening the specified file, this function leaves with an appropriate file related leave code.

Parameters

RFs &aFs

A reference to a file server session for the decoder to use.

const TDesC &aSourceFilename

The name of the file to be decoded.

const TDesC8 &aMIMEType

The MIME type of the image in the file.

const TOptions aOptions

Decoder options to use.

Return value

CImageDecoder *

Returns a pointer to the newly created decoder.

Leave codes

KEComErrNoInterfaceIdentified

ECom could not find the specified interface.

KErrNotFound

Either the specific plugin decoder for this file hasn't been found, or the file itself is missing.

See also:


FileNewL()

static IMPORT_C CImageDecoder *FileNewL(RFs &aFs, const TDesC &aSourceFilename, const TOptions aOptions=EOptionNone, const TUid aImageType=TUid::Null(), const TUid aImageSubType=TUid::Null(), const TUid aDecoderUid=TUid::Null());

Description

Create a decoder for the image in the named file.

If the client supplies an image type (and sub-type, if applicable) or decoder UID, these will be used to try and select an appropriate plugin decoder. If not, then the selection will be done by matching the image header in the file. If it finds a decoder, it will be created and then used to scan the beginning of the image file.

Note: Every image format has two IDs, known as the type and the sub-type (although generally the sub-type is KNullUid). To retrieve a list of supported types and sub-types that can be decoded, use the static functions GetImageTypesL() and GetImageSubTypesL().

Parameters

RFs &aFs

A reference to a file server session for the decoder to use.

const TDesC &aSourceFilename

The name of the file to be decoded.

const TOptions aOptions

Decoder options to use.

const TUid aImageType

The image type of the image in the file (optional, defaults to KNullUid).

const TUid aImageSubType

The image sub-type of the image in the file (optional, defaults to KNullUid).

const TUid aDecoderUid

The implementation UID for a specific codec or a decoder/encoder class UID (optional, defaults to KNullUid). If this option is selected for a specific codec the image type and image sub type for the displayer must be supplied. When loading plugins by class UID the image type and image subtype are not mandatory and the first valid plugin from the list of available plugins with the specified class UID will be loaded.

Return value

CImageDecoder *

Returns a pointer to the newly created decoder.

Leave codes

KErrUnderflow

Not enough data in file to identify which plugin decoder to use.

KErrNotFound

Either the appropriate plugin decoder for this file hasn't been found, or the file itself is missing.

KEComErrNoInterfaceIdentified

ECom could not find the specified interface.

Panic codes

EIllegalImageSubType

No base type given for sub-type.

See also:


FileNewL()

static IMPORT_C CImageDecoder *FileNewL(RFs &aFs, const TDesC &aSourceFilename, const TDesC8 &aMIMEType, ContentAccess::TIntent aIntent, const TOptions aOptions=EOptionNone);

Description

Create a decoder for the image in the named file. The client supplies a MIME type which will be used to try and select an appropriate plugin decoder. If it finds a decoder it creates it and then goes on to use that decoder to scan the beginning of the image file.

Parameters

RFs &aFs

A reference to a file server session for the decoder to use.

const TDesC &aSourceFilename

The name of the file to be decoded.

const TDesC8 &aMIMEType

The MIME type of the image in the file.

ContentAccess::TIntent aIntent

The DRM Intent for image conversion.

const TOptions aOptions

The decoder options to use.

Return value

CImageDecoder *

A pointer to the newly created decoder.

Leave codes

KEComErrNoInterfaceIdentified

ECom could not find the specified interface.

KErrNotFound

Either the specific plugin decoder for this file hasn't been found, or the file itself is missing.


FileNewL()

static IMPORT_C CImageDecoder *FileNewL(RFs &aFs, const TDesC &aSourceFilename, ContentAccess::TIntent aIntent, const TOptions aOptions=EOptionNone, const TUid aImageType=TUid::Null(), const TUid aImageSubType=TUid::Null(), const TUid aDecoderUid=TUid::Null());

Description

Creates a decoder for the image in the named file. If the client supplies an image type (and sub-type, if applicable) or decoder UID, these will be used to try and select an appropriate plugin decoder. If not, then the selection will be done by matching the image header in the file. If it finds a decoder it creates it and then goes on to use that decoder to scan the beginning of the image file.

Parameters

RFs &aFs

A reference to a file server session for the decoder to use.

const TDesC &aSourceFilename

The name of the file to be decoded.

ContentAccess::TIntent aIntent

The DRM Intent for image conversion.

const TOptions aOptions

The decoder options to use. See TOptions.

const TUid aImageType

The image type of the image in the file (optional, defaults to KNullUid).

const TUid aImageSubType

The image sub-type of the image in the file (optional, defaults to KNullUid).

const TUid aDecoderUid

The implementation UID for a specific codec or a decoder/encoder class UID (optional, defaults to KNullUid). If this option is selected for a specific codec the image type and image sub type for the displayer must be supplied. When loading plugins by class UID the image type and image subtype are not mandatory and the first valid plugin from the list of available plugins with the specified class UID will be loaded.

Return value

CImageDecoder *

A pointer to the newly created decoder.

Leave codes

KErrUnderflow

Not enough data in file to identify which plugin decoder to use.

KErrNotFound

Either the appropriate plugin decoder for this file hasn't been found, or the file itself is missing.

KEComErrNoInterfaceIdentified

ECom could not find the specified interface.

Panic codes

EIllegalImageSubType

No base type given for sub-type.

See also:


FileNewL()

static IMPORT_C CImageDecoder *FileNewL(RFile &aFile, const TDesC8 &aMIMEType, ContentAccess::TIntent aIntent, const TOptions aOptions=EOptionNone);

Description

Create a decoder for the image in the named file. The client supplies a MIME type which will be used to try and select an appropriate plugin decoder. If it finds a decoder it creates it and then goes on to use that decoder to scan the beginning of the image file.

If any file related errors are encountered opening the specified file, this function leaves with an appropriate file related leave code.

Parameters

RFile &aFile

The handle of the file to decode

const TDesC8 &aMIMEType

The MIME type of the image in the file.

ContentAccess::TIntent aIntent

The DRM Intent to open the file with

const TOptions aOptions

Decoder options to use.

Return value

CImageDecoder *

Returns a pointer to the newly created decoder.

Leave codes

KEComErrNoInterfaceIdentified

ECom could not find the specified interface.

KErrNotFound

Either the appropriate plugin decoder for this file hasn't been found, or the file itself is missing.

See also:


FileNewL()

static IMPORT_C CImageDecoder *FileNewL(RFile &aFile, ContentAccess::TIntent aIntent, const TOptions aOptions=EOptionNone, const TUid aImageType=TUid::Null(), const TUid aImageSubType=TUid::Null(), const TUid aDecoderUid=TUid::Null());

Description

Creates a decoder for the image in the named file. If the client supplies an image type (and sub-type, if applicable) or decoder UID, these will be used to try and select an appropriate plugin decoder. If not, then the selection will be done by matching the image header in the file. If it finds a decoder it creates it and then goes on to use that decoder to scan the beginning of the image file.

Parameters

RFile &aFile

The handle of the file to decode

ContentAccess::TIntent aIntent

The DRM Intent for image conversion.

const TOptions aOptions

The decoder options to use. See TOptions.

const TUid aImageType

The image type of the image in the file (optional, defaults to KNullUid).

const TUid aImageSubType

The image sub-type of the image in the file (optional, defaults to KNullUid).

const TUid aDecoderUid

The implementation UID for a specific codec or a decoder/encoder class UID (optional, defaults to KNullUid). If this option is selected for a specific codec the image type and image sub type for the displayer must be supplied. When loading plugins by class UID the image type and image subtype are not mandatory and the first valid plugin from the list of available plugins with the specified class UID will be loaded.

Return value

CImageDecoder *

A pointer to the newly created decoder.

Leave codes

KErrUnderflow

Not enough data in file to identify which plugin decoder to use.

KErrNotFound

Either the appropriate plugin decoder for this file hasn't been found, or the file itself is missing.

KEComErrNoInterfaceIdentified

ECom could not find the specified interface.

Panic codes

EIllegalImageSubType

No base type given for sub-type.

See also:


FileNewL()

static IMPORT_C CImageDecoder *FileNewL(RFs &aFs, const TMMSource &aFileSource, const TDesC8 &aMIMEType, const TOptions aOptions=EOptionNone);

Description

Create a decoder for the image in the named file. The client supplies a MIME type which will be used to try and select an appropriate plugin decoder. If it finds a decoder it creates it and then goes on to use that decoder to scan the beginning of the image file.

Parameters

RFs &aFs

A reference to a file server session for the decoder to use.

const TMMSource &aFileSource

An interface between filename based and file handle.

const TDesC8 &aMIMEType

The MIME type of the image in the file.

const TOptions aOptions

The decoder options to use.

Return value

CImageDecoder *

A pointer to the newly created decoder.

Leave codes

KErrNotSupported

A matching decoder could not be found for the MIME type.

KErrNotFound

Either the specific plugin decoder for this source image hasn't been found, or the source image itself is missing.


FileNewL()

static IMPORT_C CImageDecoder *FileNewL(RFs &aFs, const TMMSource &aFileSource, const TOptions aOptions=EOptionNone, const TUid aImageType=TUid::Null(), const TUid aImageSubType=TUid::Null(), const TUid aDecoderUid=TUid::Null());

Description

Create a decoder for the image in the named source.

Parameters

RFs &aFs

A reference to a file server session for the decoder to use.

const TMMSource &aFileSource

An interface between filename based and file handle.

const TOptions aOptions

The decoder options to use.

const TUid aImageType

The image type of the image in the file.

const TUid aImageSubType

The image sub-type of the image in the file.

const TUid aDecoderUid

The implementation UID for a specific codec or a decoder/encoder class UID.

Return value

CImageDecoder *

A pointer to the newly created decoder.

Leave codes

KErrNotSupported

A matching decoder could not be found for the MIME type.

KErrNotFound

Either the specific plugin decoder for this source image hasn't been found, or the source image itself is missing.

KEComErrNoInterfaceIdentified

ECom could not find the specified interface.

Panic codes

EIllegalImageSubType

No base type given for sub-type.


DataNewL()

static IMPORT_C CImageDecoder *DataNewL(RFs &aFs, const TDesC8 &aSourceData, const TDesC8 &aMIMEType, const TOptions aOptions=EOptionNone);

Description

Create a decoder for the image in the source buffer. The client supplies a MIME type which will be used to try and select an appropriate plugin decoder. If a decoder is found it is created and then used to scan the beginning of the image file.

Parameters

RFs &aFs

A reference to a file server session for the decoder to use.

const TDesC8 &aSourceData

The buffer containing the image to be decoded. Note that the framework doesn't take a copy of the actual data, therefore both the descriptor object and the data must persist during decoding.

const TDesC8 &aMIMEType

The MIME type of the image in the file(used to determine the plugin to create).

const TOptions aOptions

Decoder options to use.

Return value

CImageDecoder *

Returns a pointer to the newly created decoder.

Leave codes

KEComErrNoInterfaceIdentified

ECom could not find the specified interface.

KErrNotFound

No appropriate plugin decoder for this image has been found.

See also:


DataNewL()

static IMPORT_C CImageDecoder *DataNewL(RFs &aFs, const TDesC8 &aSourceData, const TOptions aOptions=EOptionNone, const TUid aImageType=TUid::Null(), const TUid aImageSubType=TUid::Null(), const TUid aDecoderUid=TUid::Null());

Description

Creates a decoder for the image in the source buffer.

If the client supplies an image type (and sub-type, if applicable) or decoder UID, these will be used to try and select an appropriate plugin decoder. If not, then the selection will be done by matching the image header from the buffer. If it finds a decoder, it is created and then used to scan the beginning of the image buffer.

Parameters

RFs &aFs

A reference to a file server session for the decoder to use.

const TDesC8 &aSourceData

The buffer containing the image to be decoded. Note that the framework doesn't take a copy of the actual data, therefore both the descriptor object and the data must persist during decoding.

const TOptions aOptions

Decoder options to use.

const TUid aImageType

The image type of the image in the file (optional, defaults to KNullUid).

const TUid aImageSubType

The image sub-type of the image in the file (optional, defaults to KNullUid).

const TUid aDecoderUid

The implementation UID for a specific codec or a decoder/encoder class UID (optional, defaults to KNullUid). If this option is selected for a specific codec the image type and image sub type for the displayer must be supplied. When loading plugins by class UID the image type and image subtype are not mandatory and the first valid plugin from the list of available plugins with the specified class UID will be loaded.

Return value

CImageDecoder *

Returns a pointer to the newly created decoder.

Leave codes

KErrUnderflow

Not enough data in descriptor to identify which plugin decoder to use.

KErrNotFound

No appropriate plugin decoder for this image has been found.

KEComErrNoInterfaceIdentified

ECom could not find the specified interface.

Panic codes

EIllegalImageSubType

No base type given for sub-type.

See also:


Convert()

virtual IMPORT_C void Convert(TRequestStatus *aRequestStatus, CFbsBitmap &aDestination, TInt aFrameNumber=0);

Pre-Condition

The destination bitmap aDestination, must be created before the call to Convert() is made. aDestination must be large enough to contain the frame and be set to the required display mode. FrameInfo() can be used to obtain the size and display mode of the frame.

Description

Start decoding an image frame asynchronously.

When the conversion is complete, successfully or otherwise, the status is returned in aRequestStatus.

If the operations completes with KErrUnderflow, then there is insufficient information in the descriptor. In this situation, ContinueConvert() should be called repeatedly until the descriptor has accumulated enough information for ContinueConvert() to complete with KErrNone. It is the responsibility of the caller to ensure that the original data source used to create this decoder object gets enough information. If there is no data available then a caller can ignore this error code and use partially decoded image.

Parameters

TRequestStatus *aRequestStatus

Request status. On completion contains an error code. KErrNone if frame was decoded successfully, KErrUnderflow if the frame was partially decoded otherwise another of the system-wide error codes.

CFbsBitmap &aDestination

A bitmap that will contain the decoded frame.

TInt aFrameNumber

The frame in a multi-frame image to decode (optional, defaults to zero).


Convert()

virtual IMPORT_C void Convert(TRequestStatus *aRequestStatus, CFbsBitmap &aDestination, CFbsBitmap &aDestinationMask, TInt aFrameNumber=0);

Pre-Condition

The destination bitmap aDestination, must be created before the call to Convert() is made. aDestination must be large enough to contain the frame and be set to the required display mode. FrameInfo() can be used to obtain the size and display mode of the frame. The destination mask aDestinationMask must be created before the call to Convert() is made and must be large enough for the mask. The display mode must be EGray2 or EGray256 and must be EGray256 if the image contains alpha-blending information. This information can be obtained from the iFlags property of TFrameInfo obtained from a FrameInfo() call.

Description

Start decoding an image frame and mask asynchronously.

When the conversion is complete, successfully or otherwise, the status is returned in aRequestStatus.

If the operations completes with KErrUnderflow, then there is insufficient information in the descriptor. In this situation, ContinueConvert() should be called repeatedly until the descriptor has accumulated enough information for ContinueConvert() to complete with KErrNone. It is the responsibility of the caller to ensure that the original data source used to create this decoder object gets enough information. If there is no data available then a caller can ignore this error code and use partially decoded image.

Parameters

TRequestStatus *aRequestStatus

Request status. On completion contains an error code. KErrNone if frame was decoded successfully, KErrUnderflow if the frame was partially decoded otherwise another of the system-wide error codes.

CFbsBitmap &aDestination

A bitmap that will contain the decoded frame.

CFbsBitmap &aDestinationMask

A bitmap that will contain the decoded frame mask.

TInt aFrameNumber

The frame in multi-frame image to decode (optional, defaults to zero).

See also:


ContinueConvert()

virtual IMPORT_C void ContinueConvert(TRequestStatus *aRequestStatus);

Description

Continue decoding a frame and/or mask after new image data was added to the source file or descriptor and a previous call to Convert() or ContinueConvert() returned KErrUnderflow.

Parameters

TRequestStatus *aRequestStatus

Request status. On completion contains an error code. KErrNone if frame was decoded successfully, KErrUnderflow if the frame was partially decoded otherwise another of the system-wide error codes.


Cancel()

IMPORT_C void Cancel();

Description

Cancels any conversions currently in progress (Cancel is synchronous).


FrameCount()

IMPORT_C TInt FrameCount() const;

Description

Return the number of frames in the image being decoded.

This function can be called immediately after the call to create the decoder, thus enabling the caller to know how many frames need to be converted. Client may have to call IsImageHeaderProcessingComplete() & ContinueProcessingHeaders() to ensure all all data is available.

Return value

TInt

The number of frames in the source image.


IsImageHeaderProcessingComplete()

IMPORT_C TBool IsImageHeaderProcessingComplete() const;

Description

Return the status of the image.

If the image is incomplete EFalse will be returned. The client should continue to supply more data and call ContinueProcessingHeaders() until ETrue is returned.

Return value

TBool

Image status.


ContinueProcessingHeaderL()

IMPORT_C void ContinueProcessingHeaderL();

Description

Continue processing image headers after new image data was added to the source file or descriptor.

See also:


FrameInfo()

IMPORT_C const TFrameInfo &FrameInfo(TInt aFrameNumber=0) const;

Description

Return the frame info for a specified frame of the image.

This function can be called immediately after the call to create the decoder, thus enabling the caller to know about each frame in advance of converting it.

The returned information contains details of the size of the image, the dimensions of the frame, its colour depth and so on. More advanced information may be available for the image using FrameData().

Use FrameCount() to determine how many frames are contained in the image before using this function.

Parameters

TInt aFrameNumber

The frame number.

Return value

const TFrameInfo &

The returtned information for the specified frame.

Panic codes

EFrameNumberOutOfRange

Frame number outside the range 0 to FrameCount()-1.


FrameData()

IMPORT_C const CFrameImageData &FrameData(TInt aFrameNumber=0) const;

Description

Returns additional plugin specific information on a specified frame.

The plugin specific information usually covers advanced image features such as image quality, advanced colour settings and so on.

Use FrameCount() to determine how many frames are contained in the image before using this function.

Parameters

TInt aFrameNumber

The frame number.

Return value

const CFrameImageData &

The data for the specified frame.

Panic codes

EFrameNumberOutOfRange

Frame number outside the range 0 to FrameCount()-1.


NumberOfImageComments()

IMPORT_C TInt NumberOfImageComments() const;

Description

Return the number of comments attached to the image (as opposed to a particular frame).

Return value

TInt

The number of comments attached to the image.


ImageCommentL()

IMPORT_C HBufC *ImageCommentL(TInt aCommentNumber) const;

Description

Return a particular comment attached to the image.

Ownership of the returned buffer is transferred to the caller. Use NumberOfImageComments() to determine how many (if any) comments are contained within the image.

Parameters

TInt aCommentNumber

The comment number.

Return value

HBufC *

A buffer containing the comment.


NumberOfFrameComments()

IMPORT_C TInt NumberOfFrameComments(TInt aFrameNumber) const;

Description

Return the number of comments attached to a given frame of the image (as opposed to the whole image).

Use FrameCount() to retrieve the number of frames in the image to ensure that a valid aFrameNumber is used.

Parameters

TInt aFrameNumber

The frame number.

Return value

TInt

The number of comments attached to a given frame of the image.


FrameCommentL()

IMPORT_C HBufC *FrameCommentL(TInt aFrameNumber, TInt aCommentNumber) const;

Description

Return a particular comment attached to a given frame of the image.

The desired order of calling methods should be FrameCount(),NumberOfFrameComments() and then FrameCommentL().

Use FrameCount() to retrieve the number of frames in the image to ensure that a valid aFrameNumber is used.

Use NumberOfFrameComments() to retrieve the number of comments attached to a given frame of the image (as opposed to the whole image),to ensure that a valid aCommentNumber is used.

Ownership of the returned buffer is transferred to the caller.

Parameters

TInt aFrameNumber

The frame number within the image from which to retrieve the specified comment.

TInt aCommentNumber

The comment number to retrieve from the specified frame.

Return value

HBufC *

A buffer containing the specified comment.

Panic codes

This

function may panic with panic category 'ImageConversion' and panic code 13 when called before the header is processed.See the CImageDecoder::IsImageHeaderProcessingComplete().

This

function panics with panic category 'ImageConversion' and panic code 10 when aFrameNumber is not valid.

This

function panics with panic category 'ImageConversion' and panic code 14 when aCommentNumber is not valid.


FrameInfoStringsLC()

IMPORT_C CFrameInfoStrings *FrameInfoStringsLC(TInt aFrameNumber=0);

Description

Return the formatted frame information strings for a specific frame and leave it on the cleanup stack.

Ownership is transferred to the caller.

Parameters

TInt aFrameNumber

The frame number from which to retrieve the formatted information string.

Return value

CFrameInfoStrings *

The formatted frame information strings.


FrameInfoStringsL()

IMPORT_C CFrameInfoStrings *FrameInfoStringsL(TInt aFrameNumber=0);

Description

Return the formatted frame information strings for a specific frame. Ownership is transferred to the caller.

Parameters

TInt aFrameNumber

The frame number from which to retrieve the formatted information string.

Return value

CFrameInfoStrings *

The formatted frame information strings.


ImplementationUid()

IMPORT_C TUid ImplementationUid() const;

Description

Return the implementation UID of the decoder being used to decode the image.

Return value

TUid

The implementation UID of the decoder.


ImageType()

IMPORT_C void ImageType(TInt aFrameNumber, TUid &aImageType, TUid &aImageSubType) const;

Description

Retrieves the image type and sub-type for a given frame of the image that has just been decoded.

Parameters

TInt aFrameNumber

The frame number for which type information should be retreived.

TUid &aImageType

On return contains the image type UID for the specified frame.

TUid &aImageSubType

On return contains the image sub-type UID if there is one (or KNullUid if there is not).


SetAgentProperty()

IMPORT_C TInt SetAgentProperty(ContentAccess::TAgentProperty aProperty, TInt aValue);

Description

Sets the properties for the Image decoder.

Parameters

ContentAccess::TAgentProperty aProperty

The property to set.

TInt aValue

The value of the property.

Return value

TInt

KErrNone if successful, otherwise one of the system-wide errors.


SetImageTypeL()

IMPORT_C void SetImageTypeL(TInt aImageType);

Description

Set the source image type, this can be any value from TImageType. It can leave with a system wide error. Typical leaves are documented below.

Parameters

TInt aImageType

An image type from TImageType to denote source image that the decoder should use.

Leave codes

KErrNotFound

If the image for the type specified is not found.

KErrCorrupt

For a corrupt image. In the case of failing to change the source image from a valid EImageTypeMain image to a corrupt EImageTypeThumbnail, the decoder resets the image type back to the valid EImageTypeMain.


ReductionFactor()

IMPORT_C TInt ReductionFactor(const TSize &aOriginalSize, const TSize &aReducedSize) const;

Description

Function to calculate the reduction factor based on the input parameters.

Parameters

const TSize &aOriginalSize

A reference to the original size of an image.

const TSize &aReducedSize

A reference to the new size of an image.

Return value

TInt

The reduction factor.


ReducedSize()

IMPORT_C TInt ReducedSize(const TSize &aOriginalSize, TInt aReductionFactor, TSize &aReducedSize) const;

Description

Calculates reduced size of the decoded bitmap based on the input parameters and updates aReducedSize with this value.

Parameters

const TSize &aOriginalSize

A reference to the original size of an image.

TInt aReductionFactor

The Reduction Factor to be applied

TSize &aReducedSize

A reference to the new size of the image.

Return value

TInt

An error code indicating if the function call was successful. KErrNone on success, otherwise KErrArgument.


SetDecoderThreadPriority()

IMPORT_C TInt SetDecoderThreadPriority(TThreadPriority aPriority);

Description

Set the decoder worker thread priority

Parameters

TThreadPriority aPriority

a new value for worker thread priority

Return value

TInt

KErrNotSupported the decoder object doesn't use a worker thread. Other system-wide error codes.

See also:


CustomSyncL()

protected: IMPORT_C void CustomSyncL(TInt aParam);

Description

Calls CImageDecoderPlugin::HandleCustomSyncL(aParam) that executes user defined plugin specific functions. Subsequent behaviour depends on the CImageDecoderPlugin class.

This function is part of the support for extended codecs for use within classes derived from CImageDecoder.

Note: This function is intended for use by plugin writers only.

Parameters

TInt aParam

Interpretation dependent on plugin.

See also:


CustomAsync()

protected: IMPORT_C void CustomAsync(TRequestStatus *aRequestStatus, TInt aParam);

Description

Sets up background convert cycle, bypassing Convert(). A call to this will result in a call to the associated CImageDecoderPlugin::InitCustomAsyncL(aParam), which if successful will start background processing. This function uses the same mechanism as Convert(), and therefore cannot be used concurrently. Cancel() etc work as expected.

Note: This function is intended for use by plugin writers only.

Parameters

TRequestStatus *aRequestStatus

Request status. On completion contains an error code. KErrNone if the bitmap was successfully decoded, otherwise another of the system-wide error codes.

TInt aParam

Interpretation dependent on plugin.


Plugin()

protected: IMPORT_C CImageDecoderPlugin *Plugin() const;

Description

Returns associated CImageDecoderPlugin.

Allows the extended CImageDecoder object to talk to its CImageDecoderPlugin equivalent.

Note: This function is intendend for use by plugin writers only.

Return value

CImageDecoderPlugin *

A pointer to the related CImageDecoderPlugin instance.

[Top]


Member enumerations


Enum TOptions

TOptions

Description

Flags to control how the image is decoded. These can be combined using an OR operation.

EOptionNone

No flag set

EOptionNoDither

Do not dither the decoded image

EOptionAlwaysThread

Perform the decoding in a separate thread

EOptionAllowZeroFrameOpen

Allow Opens to complete with no error if there is less than one frame available. This should be set for streaming.

EAllowGeneratedMask

Setting this flag requests that the plugin generate a mask during decoding.

Note:

This option is only relevant to image formats that do not already contain mask information.

The client must check that TFrameInfo::ETransparencyPossible is set before attempting to obtain the mask, because not all plugins support mask generation.

EPreferFastDecode

Use the highest possible image decoding speed; this may result in lower image quality. This flag is more applicable to formats which use "lossy" compression algorithms, such as JPEG. Decoders that do not support fast decoding will ignore it.

EOptionIgnoreExifMetaData

When specified, this flag indicates that the decoder must ignore the EXIF meta-data, if present. In this case, the ExifMetaData() should return NULL. This option value is also used to indicate the requirement to ignore the EXIF meta-data when doing the image transformation.


Enum TImageType

TImageType

Description

Flags to control which image is decoded. This can be used when the source file or descriptor contains multiple distinct image sources.

EImageTypeThumbnail

Use the thumbnail as source image

EImageTypeMain

Use the main image